home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
You can browse this item here: ibnc2_0a.tar
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
100%
| file
| POSIX tar archive (GNU)
| default
| |
99%
| file
| POSIX tar archive (GNU), directory ibnc2.0a/, mode 40755 , uid 0 , gid 0 , size 0 , seconds 6524361207, user v00d00, group wheel
| default
| |
98%
| file
| data
| default
| |
62%
| TrID
| TAR - Tape ARchive (GNU)
| default
| |
37%
| TrID
| TAR - Tape ARchive (directory)
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| GNU tar archive
| default
| |
100%
| detectItEasy
| Archive: tar
| default
| |
100%
| binwalkID
| POSIX tar archive (GNU), owner user name: "/"
| default
| |
100%
| xdgMime
| application/x-tar
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 69 62 6e 63 32 2e 30 61 | 2f 00 00 00 00 00 00 00 |ibnc2.0a|/.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 20 20 |.... 407|55 . |
|00000070| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 36 35 32 34 33 36 31 | 0 | 6524361|
|00000090| 32 30 37 20 20 31 30 34 | 31 30 00 20 35 00 00 00 |207 104|10. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 76 30 30 64 30 30 00 |.ustar |.v00d00.|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 69 62 6e 63 32 2e 30 61 | 2f 63 6f 6e 66 2e 63 00 |ibnc2.0a|/conf.c.|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 31 30 30 36 | 30 30 20 00 20 20 20 20 |....1006|00 . |
|00000270| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000280| 20 20 31 32 36 33 34 20 | 20 36 35 32 34 33 36 31 | 12634 | 6524361|
|00000290| 32 30 37 20 20 31 31 36 | 31 34 00 20 30 00 00 00 |207 116|14. 0...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 76 30 30 64 30 30 00 |.ustar |.v00d00.|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 2f 2a 0a 20 20 20 54 68 | 69 73 20 66 69 6c 65 20 |/*. Th|is file |
|00000410| 69 73 20 70 61 72 74 20 | 6f 66 20 74 68 65 20 49 |is part |of the I|
|00000420| 52 43 20 42 6f 75 6e 63 | 65 20 73 6f 75 72 63 65 |RC Bounc|e source|
|00000430| 20 63 6f 64 65 0a 20 20 | 20 63 6f 70 79 72 69 67 | code. | copyrig|
|00000440| 68 74 20 28 63 29 20 31 | 39 39 38 20 76 30 30 64 |ht (c) 1|998 v00d|
|00000450| 30 30 20 4e 65 74 20 53 | 65 72 76 69 63 65 73 0a |00 Net S|ervices.|
|00000460| 20 20 20 61 6e 64 20 69 | 73 20 64 69 73 74 72 69 | and i|s distri|
|00000470| 62 75 74 65 64 20 61 63 | 63 6f 72 64 69 6e 67 20 |buted ac|cording |
|00000480| 74 6f 20 74 68 65 20 47 | 4e 55 20 67 65 6e 65 72 |to the G|NU gener|
|00000490| 61 6c 20 70 75 62 6c 69 | 63 20 6c 69 63 65 6e 73 |al publi|c licens|
|000004a0| 65 2e 0a 0a 20 20 20 54 | 68 69 73 20 70 72 6f 67 |e... T|his prog|
|000004b0| 72 61 6d 20 69 73 20 66 | 72 65 65 20 73 6f 66 74 |ram is f|ree soft|
|000004c0| 77 61 72 65 3b 20 79 6f | 75 20 63 61 6e 20 72 65 |ware; yo|u can re|
|000004d0| 64 69 73 74 72 69 62 75 | 74 65 20 69 74 20 61 6e |distribu|te it an|
|000004e0| 64 2f 6f 72 20 6d 6f 64 | 69 66 79 0a 20 20 20 69 |d/or mod|ify. i|
|000004f0| 74 20 75 6e 64 65 72 20 | 74 68 65 20 74 65 72 6d |t under |the term|
|00000500| 73 20 6f 66 20 74 68 65 | 20 47 4e 55 20 47 65 6e |s of the| GNU Gen|
|00000510| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|00000520| 6e 73 65 20 61 73 20 70 | 75 62 6c 69 73 68 65 64 |nse as p|ublished|
|00000530| 20 62 79 0a 20 20 20 74 | 68 65 20 46 72 65 65 20 | by. t|he Free |
|00000540| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|00000550| 69 6f 6e 3b 20 65 69 74 | 68 65 72 20 76 65 72 73 |ion; eit|her vers|
|00000560| 69 6f 6e 20 32 20 6f 66 | 20 74 68 65 20 4c 69 63 |ion 2 of| the Lic|
|00000570| 65 6e 73 65 2c 20 6f 72 | 0a 20 20 20 28 61 74 20 |ense, or|. (at |
|00000580| 79 6f 75 72 20 6f 70 74 | 69 6f 6e 29 20 61 6e 79 |your opt|ion) any|
|00000590| 20 6c 61 74 65 72 20 76 | 65 72 73 69 6f 6e 2e 0a | later v|ersion..|
|000005a0| 0a 20 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d |. This| program|
|000005b0| 20 69 73 20 64 69 73 74 | 72 69 62 75 74 65 64 20 | is dist|ributed |
|000005c0| 69 6e 20 74 68 65 20 68 | 6f 70 65 20 74 68 61 74 |in the h|ope that|
|000005d0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 75 73 65 66 | it will| be usef|
|000005e0| 75 6c 2c 0a 20 20 20 62 | 75 74 20 57 49 54 48 4f |ul,. b|ut WITHO|
|000005f0| 55 54 20 41 4e 59 20 57 | 41 52 52 41 4e 54 59 3b |UT ANY W|ARRANTY;|
|00000600| 20 77 69 74 68 6f 75 74 | 20 65 76 65 6e 20 74 68 | without| even th|
|00000610| 65 20 69 6d 70 6c 69 65 | 64 20 77 61 72 72 61 6e |e implie|d warran|
|00000620| 74 79 20 6f 66 0a 20 20 | 20 4d 45 52 43 48 41 4e |ty of. | MERCHAN|
|00000630| 54 41 42 49 4c 49 54 59 | 20 6f 72 20 46 49 54 4e |TABILITY| or FITN|
|00000640| 45 53 53 20 46 4f 52 20 | 41 20 50 41 52 54 49 43 |ESS FOR |A PARTIC|
|00000650| 55 4c 41 52 20 50 55 52 | 50 4f 53 45 2e 20 20 53 |ULAR PUR|POSE. S|
|00000660| 65 65 20 74 68 65 0a 20 | 20 20 47 4e 55 20 47 65 |ee the. | GNU Ge|
|00000670| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 20 4c 69 63 |neral Pu|blic Lic|
|00000680| 65 6e 73 65 20 66 6f 72 | 20 6d 6f 72 65 20 64 65 |ense for| more de|
|00000690| 74 61 69 6c 73 2e 0a 0a | 20 20 20 59 6f 75 20 73 |tails...| You s|
|000006a0| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|000006b0| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|000006c0| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|000006d0| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 0a 20 20 20 |blic Lic|ense. |
|000006e0| 61 6c 6f 6e 67 20 77 69 | 74 68 20 74 68 69 73 20 |along wi|th this |
|000006f0| 70 72 6f 67 72 61 6d 3b | 20 69 66 20 6e 6f 74 2c |program;| if not,|
|00000700| 20 77 72 69 74 65 20 74 | 6f 20 74 68 65 20 46 72 | write t|o the Fr|
|00000710| 65 65 20 53 6f 66 74 77 | 61 72 65 0a 20 20 20 46 |ee Softw|are. F|
|00000720| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 2c |oundatio|n, Inc.,|
|00000730| 20 36 37 35 20 4d 61 73 | 73 20 41 76 65 2c 20 43 | 675 Mas|s Ave, C|
|00000740| 61 6d 62 72 69 64 67 65 | 2c 20 4d 41 20 30 32 31 |ambridge|, MA 021|
|00000750| 33 39 2c 20 55 53 41 2e | 0a 0a 20 20 20 54 68 65 |39, USA.|.. The|
|00000760| 20 61 75 74 68 6f 72 20 | 28 52 6f 62 65 72 74 20 | author |(Robert |
|00000770| 43 6c 61 72 6b 29 20 63 | 61 6e 20 62 65 20 72 65 |Clark) c|an be re|
|00000780| 61 63 68 65 64 20 61 74 | 3a 20 76 30 30 64 30 30 |ached at|: v00d00|
|00000790| 40 68 65 6d 70 73 65 65 | 64 2e 63 6f 6d 0a 0a 20 |@hempsee|d.com.. |
|000007a0| 20 20 54 68 69 73 20 63 | 6f 64 65 20 69 73 20 62 | This c|ode is b|
|000007b0| 61 73 65 64 20 6f 6e 20 | 49 72 63 20 50 72 6f 78 |ased on |Irc Prox|
|000007c0| 79 20 28 63 29 31 39 39 | 37 2d 39 38 20 4a 61 6d |y (c)199|7-98 Jam|
|000007d0| 65 73 20 53 65 74 65 72 | 0a 2a 2f 0a 0a 23 69 6e |es Seter|.*/..#in|
|000007e0| 63 6c 75 64 65 20 22 63 | 6f 6d 6d 6f 6e 2e 68 22 |clude "c|ommon.h"|
|000007f0| 0a 0a 73 74 72 75 63 74 | 20 76 68 6f 73 74 20 2a |..struct| vhost *|
|00000800| 61 64 64 76 68 6f 73 74 | 28 73 74 72 75 63 74 20 |addvhost|(struct |
|00000810| 76 68 6f 73 74 20 2a 6c | 69 73 74 5f 70 74 72 29 |vhost *l|ist_ptr)|
|00000820| 0a 7b 0a 20 20 20 77 68 | 69 6c 65 20 28 6c 69 73 |.{. wh|ile (lis|
|00000830| 74 5f 70 74 72 2d 3e 6e | 65 78 74 21 3d 4e 55 4c |t_ptr->n|ext!=NUL|
|00000840| 4c 29 20 6c 69 73 74 5f | 70 74 72 3d 6c 69 73 74 |L) list_|ptr=list|
|00000850| 5f 70 74 72 2d 3e 6e 65 | 78 74 3b 0a 20 20 20 6c |_ptr->ne|xt;. l|
|00000860| 69 73 74 5f 70 74 72 2d | 3e 6e 65 78 74 3d 28 73 |ist_ptr-|>next=(s|
|00000870| 74 72 75 63 74 20 76 68 | 6f 73 74 20 2a 29 20 6d |truct vh|ost *) m|
|00000880| 61 6c 6c 6f 63 20 28 73 | 69 7a 65 6f 66 20 28 73 |alloc (s|izeof (s|
|00000890| 74 72 75 63 74 20 76 68 | 6f 73 74 29 29 3b 0a 20 |truct vh|ost));. |
|000008a0| 20 20 69 66 20 28 6c 69 | 73 74 5f 70 74 72 2d 3e | if (li|st_ptr->|
|000008b0| 6e 65 78 74 21 3d 4e 55 | 4c 4c 29 20 28 6c 69 73 |next!=NU|LL) (lis|
|000008c0| 74 5f 70 74 72 2d 3e 6e | 65 78 74 29 2d 3e 6e 65 |t_ptr->n|ext)->ne|
|000008d0| 78 74 3d 28 73 74 72 75 | 63 74 20 76 68 6f 73 74 |xt=(stru|ct vhost|
|000008e0| 20 2a 29 20 4e 55 4c 4c | 3b 0a 20 20 20 72 65 74 | *) NULL|;. ret|
|000008f0| 75 72 6e 20 28 6c 69 73 | 74 5f 70 74 72 2d 3e 6e |urn (lis|t_ptr->n|
|00000900| 65 78 74 29 3b 0a 7d 0a | 0a 69 6e 74 0a 6c 6f 61 |ext);.}.|.int.loa|
|00000910| 64 63 6f 6e 66 28 74 63 | 6f 6e 66 20 2a 63 6f 6e |dconf(tc|onf *con|
|00000920| 66 29 0a 7b 0a 20 20 20 | 46 49 4c 45 20 2a 66 3b |f).{. |FILE *f;|
|00000930| 0a 20 20 20 63 68 61 72 | 20 2a 63 6f 6e 66 63 6d |. char| *confcm|
|00000940| 64 2c 2a 63 6f 6e 66 76 | 61 6c 2c 6c 69 6e 65 5b |d,*confv|al,line[|
|00000950| 31 30 30 5d 3b 0a 20 20 | 20 69 6e 74 20 68 6f 77 |100];. | int how|
|00000960| 66 61 72 3b 0a 0a 20 20 | 20 69 66 20 28 28 66 3d |far;.. | if ((f=|
|00000970| 66 6f 70 65 6e 28 63 6f | 6e 66 2d 3e 63 66 67 66 |fopen(co|nf->cfgf|
|00000980| 69 6c 65 2c 22 72 22 29 | 29 3d 3d 4e 55 4c 4c 29 |ile,"r")|)==NULL)|
|00000990| 20 72 65 74 75 72 6e 20 | 30 3b 0a 20 20 20 68 6f | return |0;. ho|
|000009a0| 77 66 61 72 3d 30 3b 0a | 20 20 20 77 68 69 6c 65 |wfar=0;.| while|
|000009b0| 28 21 66 65 6f 66 28 66 | 29 29 20 7b 0a 20 20 20 |(!feof(f|)) {. |
|000009c0| 20 20 20 6d 65 6d 73 65 | 74 28 6c 69 6e 65 2c 30 | memse|t(line,0|
|000009d0| 2c 73 69 7a 65 6f 66 28 | 6c 69 6e 65 29 29 3b 0a |,sizeof(|line));.|
|000009e0| 20 20 20 20 20 20 66 67 | 65 74 73 28 6c 69 6e 65 | fg|ets(line|
|000009f0| 2c 73 69 7a 65 6f 66 28 | 6c 69 6e 65 29 2c 66 29 |,sizeof(|line),f)|
|00000a00| 3b 0a 20 20 20 20 20 20 | 68 6f 77 66 61 72 2b 2b |;. |howfar++|
|00000a10| 3b 0a 20 20 20 20 20 20 | 69 66 20 28 21 73 74 72 |;. |if (!str|
|00000a20| 6c 65 6e 28 6c 69 6e 65 | 29 29 20 63 6f 6e 74 69 |len(line|)) conti|
|00000a30| 6e 75 65 3b 0a 20 20 20 | 20 20 20 69 66 20 28 73 |nue;. | if (s|
|00000a40| 74 72 6e 63 6d 70 28 6c | 69 6e 65 2c 22 23 22 2c |trncmp(l|ine,"#",|
|00000a50| 31 29 29 20 7b 0a 20 20 | 20 20 20 20 20 20 20 63 |1)) {. | c|
|00000a60| 6f 6e 66 63 6d 64 3d 4e | 55 4c 4c 3b 0a 20 20 20 |onfcmd=N|ULL;. |
|00000a70| 20 20 20 20 20 20 63 6f | 6e 66 76 61 6c 3d 4e 55 | co|nfval=NU|
|00000a80| 4c 4c 3b 0a 20 20 20 20 | 20 20 20 20 20 63 6f 6e |LL;. | con|
|00000a90| 66 63 6d 64 3d 73 74 72 | 74 6f 6b 28 6c 69 6e 65 |fcmd=str|tok(line|
|00000aa0| 2c 22 3a 22 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |,":");. | |
|00000ab0| 69 66 20 28 21 63 6f 6e | 66 63 6d 64 29 20 63 6f |if (!con|fcmd) co|
|00000ac0| 6e 74 69 6e 75 65 3b 0a | 20 20 20 20 20 20 20 20 |ntinue;.| |
|00000ad0| 20 63 6f 6e 66 76 61 6c | 3d 73 74 72 74 6f 6b 28 | confval|=strtok(|
|00000ae0| 4e 55 4c 4c 2c 22 5c 6e | 22 29 3b 0a 20 20 20 20 |NULL,"\n|");. |
|00000af0| 20 20 20 20 20 69 66 20 | 28 21 63 6f 6e 66 76 61 | if |(!confva|
|00000b00| 6c 29 20 63 6f 6e 74 69 | 6e 75 65 3b 0a 20 20 20 |l) conti|nue;. |
|00000b10| 20 20 20 20 20 20 69 66 | 20 28 21 6f 70 74 69 6f | if| (!optio|
|00000b20| 6e 28 63 6f 6e 66 2c 63 | 6f 6e 66 63 6d 64 2c 63 |n(conf,c|onfcmd,c|
|00000b30| 6f 6e 66 76 61 6c 29 29 | 0a 20 20 20 20 20 20 20 |onfval))|. |
|00000b40| 20 20 20 20 20 70 72 69 | 6e 74 66 28 22 43 6f 6e | pri|ntf("Con|
|00000b50| 66 69 67 20 6c 69 6e 65 | 20 25 69 20 72 65 6a 65 |fig line| %i reje|
|00000b60| 63 74 65 64 20 28 69 6e | 76 61 6c 69 64 20 63 6f |cted (in|valid co|
|00000b70| 6d 6d 61 6e 64 20 27 25 | 73 27 29 5c 6e 22 2c 68 |mmand '%|s')\n",h|
|00000b80| 6f 77 66 61 72 2c 63 6f | 6e 66 63 6d 64 29 3b 0a |owfar,co|nfcmd);.|
|00000b90| 20 20 20 20 20 20 7d 0a | 20 20 20 7d 0a 20 20 20 | }.| }. |
|00000ba0| 66 63 6c 6f 73 65 28 66 | 29 3b 0a 7d 0a 0a 69 6e |fclose(f|);.}..in|
|00000bb0| 74 0a 6f 70 74 69 6f 6e | 28 74 63 6f 6e 66 20 2a |t.option|(tconf *|
|00000bc0| 63 6f 6e 66 2c 20 63 68 | 61 72 20 2a 63 6d 64 2c |conf, ch|ar *cmd,|
|00000bd0| 20 63 68 61 72 20 2a 76 | 61 6c 29 0a 7b 0a 20 20 | char *v|al).{. |
|00000be0| 20 73 74 72 75 63 74 20 | 76 68 6f 73 74 20 2a 74 | struct |vhost *t|
|00000bf0| 6d 70 76 68 73 74 3b 0a | 0a 20 20 20 69 66 20 28 |mpvhst;.|. if (|
|00000c00| 21 73 74 72 63 61 73 65 | 63 6d 70 28 63 6d 64 2c |!strcase|cmp(cmd,|
|00000c10| 22 70 22 29 7c 7c 21 73 | 74 72 63 61 73 65 63 6d |"p")||!s|trcasecm|
|00000c20| 70 28 63 6d 64 2c 22 70 | 74 22 29 29 0a 20 20 20 |p(cmd,"p|t")). |
|00000c30| 20 20 20 63 6f 6e 66 2d | 3e 6c 70 6f 72 74 3d 61 | conf-|>lport=a|
|00000c40| 74 6f 69 28 76 61 6c 29 | 3b 0a 20 20 20 65 6c 73 |toi(val)|;. els|
|00000c50| 65 20 69 66 20 28 21 73 | 74 72 63 61 73 65 63 6d |e if (!s|trcasecm|
|00000c60| 70 28 63 6d 64 2c 22 6d | 22 29 7c 7c 21 73 74 72 |p(cmd,"m|")||!str|
|00000c70| 63 61 73 65 63 6d 70 28 | 63 6d 64 2c 22 6d 75 22 |casecmp(|cmd,"mu"|
|00000c80| 29 29 0a 20 20 20 20 20 | 20 63 6f 6e 66 2d 3e 6d |)). | conf->m|
|00000c90| 61 78 75 73 65 72 73 3d | 61 74 6f 69 28 76 61 6c |axusers=|atoi(val|
|00000ca0| 29 3b 0a 20 20 20 65 6c | 73 65 20 69 66 20 28 21 |);. el|se if (!|
|00000cb0| 73 74 72 63 61 73 65 63 | 6d 70 28 63 6d 64 2c 22 |strcasec|mp(cmd,"|
|00000cc0| 64 22 29 7c 7c 21 73 74 | 72 63 61 73 65 63 6d 70 |d")||!st|rcasecmp|
|00000cd0| 28 63 6d 64 2c 22 64 70 | 22 29 29 0a 20 20 20 20 |(cmd,"dp|")). |
|00000ce0| 20 20 63 6f 6e 66 2d 3e | 64 70 6f 72 74 3d 61 74 | conf->|dport=at|
|00000cf0| 6f 69 28 76 61 6c 29 3b | 0a 20 20 20 65 6c 73 65 |oi(val);|. else|
|00000d00| 20 69 66 20 28 21 73 74 | 72 63 61 73 65 63 6d 70 | if (!st|rcasecmp|
|00000d10| 28 63 6d 64 2c 22 68 22 | 29 7c 7c 21 73 74 72 63 |(cmd,"h"|)||!strc|
|00000d20| 61 73 65 63 6d 70 28 63 | 6d 64 2c 22 6c 68 22 29 |asecmp(c|md,"lh")|
|00000d30| 29 0a 20 20 20 20 20 20 | 73 74 72 6e 63 70 79 28 |). |strncpy(|
|00000d40| 63 6f 6e 66 2d 3e 6c 68 | 6f 73 74 2c 76 61 6c 2c |conf->lh|ost,val,|
|00000d50| 73 69 7a 65 6f 66 28 63 | 6f 6e 66 2d 3e 6c 68 6f |sizeof(c|onf->lho|
|00000d60| 73 74 29 29 3b 0a 20 20 | 20 65 6c 73 65 20 69 66 |st));. | else if|
|00000d70| 20 28 21 73 74 72 63 61 | 73 65 63 6d 70 28 63 6d | (!strca|secmp(cm|
|00000d80| 64 2c 22 6c 22 29 7c 7c | 21 73 74 72 63 61 73 65 |d,"l")|||!strcase|
|00000d90| 63 6d 70 28 63 6d 64 2c | 22 6c 66 22 29 29 0a 20 |cmp(cmd,|"lf")). |
|00000da0| 20 20 20 20 20 73 74 72 | 6e 63 70 79 28 63 6f 6e | str|ncpy(con|
|00000db0| 66 2d 3e 6c 6f 67 66 69 | 6c 65 2c 76 61 6c 2c 73 |f->logfi|le,val,s|
|00000dc0| 69 7a 65 6f 66 28 63 6f | 6e 66 2d 3e 6c 6f 67 66 |izeof(co|nf->logf|
|00000dd0| 69 6c 65 29 29 3b 0a 20 | 20 20 65 6c 73 65 20 69 |ile));. | else i|
|00000de0| 66 20 28 21 73 74 72 63 | 61 73 65 63 6d 70 28 63 |f (!strc|asecmp(c|
|00000df0| 6d 64 2c 22 7a 22 29 7c | 7c 21 73 74 72 63 61 73 |md,"z")|||!strcas|
|00000e00| 65 63 6d 70 28 63 6d 64 | 2c 22 70 66 22 29 29 0a |ecmp(cmd|,"pf")).|
|00000e10| 20 20 20 20 20 20 73 74 | 72 6e 63 70 79 28 63 6f | st|rncpy(co|
|00000e20| 6e 66 2d 3e 70 69 64 66 | 69 6c 65 2c 76 61 6c 2c |nf->pidf|ile,val,|
|00000e30| 73 69 7a 65 6f 66 28 63 | 6f 6e 66 2d 3e 70 69 64 |sizeof(c|onf->pid|
|00000e40| 66 69 6c 65 29 29 3b 0a | 20 20 20 65 6c 73 65 20 |file));.| else |
|00000e50| 69 66 20 28 21 73 74 72 | 63 61 73 65 63 6d 70 28 |if (!str|casecmp(|
|00000e60| 63 6d 64 2c 22 61 22 29 | 7c 7c 21 73 74 72 63 61 |cmd,"a")|||!strca|
|00000e70| 73 65 63 6d 70 28 63 6d | 64 2c 22 70 73 22 29 29 |secmp(cm|d,"ps"))|
|00000e80| 0a 20 20 20 20 20 20 73 | 74 72 6e 63 70 79 28 63 |. s|trncpy(c|
|00000e90| 6f 6e 66 2d 3e 70 61 73 | 73 2c 76 61 6c 2c 73 69 |onf->pas|s,val,si|
|00000ea0| 7a 65 6f 66 28 63 6f 6e | 66 2d 3e 70 61 73 73 29 |zeof(con|f->pass)|
|00000eb0| 29 3b 0a 20 20 20 65 6c | 73 65 20 69 66 20 28 21 |);. el|se if (!|
|00000ec0| 73 74 72 63 61 73 65 63 | 6d 70 28 63 6d 64 2c 22 |strcasec|mp(cmd,"|
|00000ed0| 66 22 29 7c 7c 21 73 74 | 72 63 61 73 65 63 6d 70 |f")||!st|rcasecmp|
|00000ee0| 28 63 6d 64 2c 22 69 64 | 22 29 29 0a 20 20 20 20 |(cmd,"id|")). |
|00000ef0| 20 20 73 74 72 6e 63 70 | 79 28 63 6f 6e 66 2d 3e | strncp|y(conf->|
|00000f00| 66 61 6b 65 69 64 2c 76 | 61 6c 2c 73 69 7a 65 6f |fakeid,v|al,sizeo|
|00000f10| 66 28 63 6f 6e 66 2d 3e | 66 61 6b 65 69 64 29 29 |f(conf->|fakeid))|
|00000f20| 3b 0a 20 20 20 65 6c 73 | 65 20 69 66 20 28 21 73 |;. els|e if (!s|
|00000f30| 74 72 63 61 73 65 63 6d | 70 28 63 6d 64 2c 22 63 |trcasecm|p(cmd,"c|
|00000f40| 22 29 7c 7c 21 73 74 72 | 63 61 73 65 63 6d 70 28 |")||!str|casecmp(|
|00000f50| 63 6d 64 2c 22 63 6c 22 | 29 29 0a 20 20 20 20 20 |cmd,"cl"|)). |
|00000f60| 20 73 74 72 6e 63 70 79 | 28 63 6f 6e 66 2d 3e 63 | strncpy|(conf->c|
|00000f70| 6c 6f 61 6b 2c 76 61 6c | 2c 73 69 7a 65 6f 66 28 |loak,val|,sizeof(|
|00000f80| 63 6f 6e 66 2d 3e 63 6c | 6f 61 6b 29 29 3b 0a 20 |conf->cl|oak));. |
|00000f90| 20 20 65 6c 73 65 20 69 | 66 20 28 21 73 74 72 63 | else i|f (!strc|
|00000fa0| 61 73 65 63 6d 70 28 63 | 6d 64 2c 22 6f 22 29 29 |asecmp(c|md,"o"))|
|00000fb0| 0a 20 20 20 20 20 20 73 | 74 72 6e 63 70 79 28 63 |. s|trncpy(c|
|00000fc0| 6f 6e 66 2d 3e 6f 70 65 | 72 2c 76 61 6c 2c 73 69 |onf->ope|r,val,si|
|00000fd0| 7a 65 6f 66 28 63 6f 6e | 66 2d 3e 6f 70 65 72 29 |zeof(con|f->oper)|
|00000fe0| 29 3b 0a 20 20 20 65 6c | 73 65 20 69 66 20 28 21 |);. el|se if (!|
|00000ff0| 73 74 72 63 61 73 65 63 | 6d 70 28 63 6d 64 2c 22 |strcasec|mp(cmd,"|
|00001000| 76 22 29 7c 7c 21 73 74 | 72 63 61 73 65 63 6d 70 |v")||!st|rcasecmp|
|00001010| 28 63 6d 64 2c 22 76 68 | 22 29 29 20 7b 0a 20 20 |(cmd,"vh|")) {. |
|00001020| 20 20 20 20 69 66 28 63 | 6f 6e 66 2d 3e 76 68 6f | if(c|onf->vho|
|00001030| 73 74 73 2e 68 6f 73 74 | 5b 30 5d 20 3d 3d 20 30 |sts.host|[0] == 0|
|00001040| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 20 73 74 72 |) {. | str|
|00001050| 6e 63 70 79 28 63 6f 6e | 66 2d 3e 76 68 6f 73 74 |ncpy(con|f->vhost|
|00001060| 73 2e 68 6f 73 74 2c 76 | 61 6c 2c 48 4f 53 54 4c |s.host,v|al,HOSTL|
|00001070| 45 4e 29 3b 0a 20 20 20 | 20 20 20 7d 20 65 6c 73 |EN);. | } els|
|00001080| 65 20 7b 0a 20 20 20 20 | 20 20 20 20 20 74 6d 70 |e {. | tmp|
|00001090| 76 68 73 74 3d 61 64 64 | 76 68 6f 73 74 28 26 63 |vhst=add|vhost(&c|
|000010a0| 6f 6e 66 2d 3e 76 68 6f | 73 74 73 29 3b 0a 20 20 |onf->vho|sts);. |
|000010b0| 20 20 20 20 20 20 20 69 | 66 28 74 6d 70 76 68 73 | i|f(tmpvhs|
|000010c0| 74 20 3d 3d 20 4e 55 4c | 4c 29 20 7b 0a 20 20 20 |t == NUL|L) {. |
|000010d0| 20 20 20 20 20 20 20 20 | 20 70 75 74 6c 6f 67 28 | | putlog(|
|000010e0| 22 52 61 6d 20 45 72 72 | 6f 72 21 22 29 3b 0a 20 |"Ram Err|or!");. |
|000010f0| 20 20 20 20 20 20 20 20 | 20 20 20 65 78 69 74 28 | | exit(|
|00001100| 2d 31 29 3b 0a 20 20 20 | 20 20 20 20 20 20 7d 0a |-1);. | }.|
|00001110| 20 20 20 20 20 20 20 20 | 20 73 74 72 6e 63 70 79 | | strncpy|
|00001120| 28 74 6d 70 76 68 73 74 | 2d 3e 68 6f 73 74 2c 76 |(tmpvhst|->host,v|
|00001130| 61 6c 2c 48 4f 53 54 4c | 45 4e 29 3b 0a 20 20 20 |al,HOSTL|EN);. |
|00001140| 20 20 20 7d 0a 20 20 20 | 7d 20 65 6c 73 65 20 72 | }. |} else r|
|00001150| 65 74 75 72 6e 20 30 3b | 0a 7d 0a 0a 23 64 65 66 |eturn 0;|.}..#def|
|00001160| 69 6e 65 20 53 59 4e 54 | 41 58 20 22 25 73 5c 74 |ine SYNT|AX "%s\t|
|00001170| 25 73 5c 6e 22 0a 0a 76 | 6f 69 64 0a 73 61 76 65 |%s\n"..v|oid.save|
|00001180| 63 6f 6e 66 28 74 63 6f | 6e 66 20 2a 63 6f 6e 66 |conf(tco|nf *conf|
|00001190| 29 0a 7b 0a 20 20 20 46 | 49 4c 45 20 2a 66 3b 0a |).{. F|ILE *f;.|
|000011a0| 20 20 20 73 74 72 75 63 | 74 20 76 68 6f 73 74 20 | struc|t vhost |
|000011b0| 2a 76 68 6f 73 74 73 3b | 0a 0a 20 20 20 76 6f 69 |*vhosts;|.. voi|
|000011c0| 64 20 73 61 76 65 73 74 | 72 28 63 68 61 72 20 2a |d savest|r(char *|
|000011d0| 69 74 65 6d 2c 20 63 68 | 61 72 20 2a 73 2c 20 63 |item, ch|ar *s, c|
|000011e0| 68 61 72 20 2a 73 32 2c | 20 69 6e 74 20 69 29 0a |har *s2,| int i).|
|000011f0| 20 20 20 7b 20 66 70 72 | 69 6e 74 66 28 66 2c 22 | { fpr|intf(f,"|
|00001200| 25 73 25 73 3a 25 73 5c | 6e 22 2c 28 28 28 28 69 |%s%s:%s\|n",((((i|
|00001210| 3d 3d 31 29 26 26 28 21 | 73 74 72 63 6d 70 28 73 |==1)&&(!|strcmp(s|
|00001220| 2c 73 32 29 29 29 7c 7c | 28 21 28 2a 73 29 29 29 |,s2)))|||(!(*s)))|
|00001230| 20 3f 20 22 23 22 20 3a | 20 22 22 29 2c 69 74 65 | ? "#" :| ""),ite|
|00001240| 6d 2c 28 2a 73 20 3f 20 | 73 20 3a 20 73 32 29 29 |m,(*s ? |s : s2))|
|00001250| 3b 20 7d 0a 0a 20 20 20 | 76 6f 69 64 20 73 61 76 |; }.. |void sav|
|00001260| 65 69 6e 74 28 63 68 61 | 72 20 2a 69 74 65 6d 2c |eint(cha|r *item,|
|00001270| 20 69 6e 74 20 69 2c 20 | 69 6e 74 20 69 32 29 0a | int i, |int i2).|
|00001280| 20 20 20 7b 20 66 70 72 | 69 6e 74 66 28 66 2c 22 | { fpr|intf(f,"|
|00001290| 25 73 25 73 3a 25 75 5c | 6e 22 2c 28 69 3d 3d 69 |%s%s:%u\|n",(i==i|
|000012a0| 32 20 3f 20 22 23 22 20 | 3a 20 22 22 29 2c 69 74 |2 ? "#" |: ""),it|
|000012b0| 65 6d 2c 69 29 3b 20 7d | 0a 0a 20 20 20 69 66 20 |em,i); }|.. if |
|000012c0| 28 28 66 3d 66 6f 70 65 | 6e 28 63 6f 6e 66 2d 3e |((f=fope|n(conf->|
|000012d0| 63 66 67 66 69 6c 65 2c | 22 77 22 29 29 3d 3d 4e |cfgfile,|"w"))==N|
|000012e0| 55 4c 4c 29 20 72 65 74 | 75 72 6e 3b 0a 20 20 20 |ULL) ret|urn;. |
|000012f0| 66 70 72 69 6e 74 66 28 | 66 2c 22 23 43 6f 6e 66 |fprintf(|f,"#Conf|
|00001300| 69 67 75 72 61 74 69 6f | 6e 20 66 69 6c 65 20 66 |iguratio|n file f|
|00001310| 6f 72 20 69 42 4e 43 20 | 25 73 5c 6e 5c 6e 22 2c |or iBNC |%s\n\n",|
|00001320| 56 45 52 53 49 4f 4e 29 | 3b 0a 20 20 20 66 70 72 |VERSION)|;. fpr|
|00001330| 69 6e 74 66 28 66 2c 53 | 59 4e 54 41 58 2c 22 23 |intf(f,S|YNTAX,"#|
|00001340| 4f 70 74 69 6f 6e 22 2c | 22 44 65 73 63 72 69 70 |Option",|"Descrip|
|00001350| 74 69 6f 6e 22 29 3b 0a | 20 20 20 66 70 72 69 6e |tion");.| fprin|
|00001360| 74 66 28 66 2c 53 59 4e | 54 41 58 2c 22 23 2d 2d |tf(f,SYN|TAX,"#--|
|00001370| 2d 2d 2d 2d 22 2c 22 2d | 2d 2d 2d 2d 2d 2d 2d 2d |----","-|--------|
|00001380| 2d 2d 22 29 3b 0a 20 20 | 20 66 70 72 69 6e 74 66 |--");. | fprintf|
|00001390| 28 66 2c 53 59 4e 54 41 | 58 2c 22 23 20 48 3a 22 |(f,SYNTA|X,"# H:"|
|000013a0| 2c 22 76 69 72 74 75 61 | 6c 20 76 68 6f 73 74 20 |,"virtua|l vhost |
|000013b0| 74 6f 20 75 73 65 20 66 | 6f 72 20 69 6e 63 6f 6d |to use f|or incom|
|000013c0| 69 6e 67 20 63 6f 6e 6e | 65 63 74 69 6f 6e 73 22 |ing conn|ections"|
|000013d0| 29 3b 0a 20 20 20 66 70 | 72 69 6e 74 66 28 66 2c |);. fp|rintf(f,|
|000013e0| 53 59 4e 54 41 58 2c 22 | 23 20 50 3a 22 2c 22 70 |SYNTAX,"|# P:","p|
|000013f0| 6f 72 74 20 74 6f 20 75 | 73 65 20 66 6f 72 20 69 |ort to u|se for i|
|00001400| 6e 63 6f 6d 69 6e 67 20 | 63 6f 6e 6e 65 63 74 69 |ncoming |connecti|
|00001410| 6f 6e 73 22 29 3b 0a 20 | 20 20 66 70 72 69 6e 74 |ons");. | fprint|
|00001420| 66 28 66 2c 53 59 4e 54 | 41 58 2c 22 23 20 56 3a |f(f,SYNT|AX,"# V:|
|00001430| 22 2c 22 76 69 72 74 75 | 61 6c 20 68 6f 73 74 28 |","virtu|al host(|
|00001440| 73 29 20 74 6f 20 75 73 | 65 20 66 6f 72 20 6f 75 |s) to us|e for ou|
|00001450| 74 67 6f 69 6e 67 20 63 | 6f 6e 6e 65 63 74 69 6f |tgoing c|onnectio|
|00001460| 6e 73 22 29 3b 0a 20 20 | 20 66 70 72 69 6e 74 66 |ns");. | fprintf|
|00001470| 28 66 2c 53 59 4e 54 41 | 58 2c 22 23 22 2c 22 28 |(f,SYNTA|X,"#","(|
|00001480| 6f 6e 65 20 76 68 6f 73 | 74 20 70 65 72 20 56 3a |one vhos|t per V:|
|00001490| 29 22 29 3b 0a 20 20 20 | 66 70 72 69 6e 74 66 28 |)");. |fprintf(|
|000014a0| 66 2c 53 59 4e 54 41 58 | 2c 22 23 20 44 3a 22 2c |f,SYNTAX|,"# D:",|
|000014b0| 22 64 65 66 61 75 6c 74 | 20 70 6f 72 74 20 74 6f |"default| port to|
|000014c0| 20 75 73 65 20 66 6f 72 | 20 6f 75 74 67 6f 69 6e | use for| outgoin|
|000014d0| 67 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 73 22 29 3b |g connec|tions");|
|000014e0| 0a 20 20 20 66 70 72 69 | 6e 74 66 28 66 2c 53 59 |. fpri|ntf(f,SY|
|000014f0| 4e 54 41 58 2c 22 23 20 | 4d 3a 22 2c 22 6d 61 78 |NTAX,"# |M:","max|
|00001500| 69 6d 75 6d 20 63 6f 6e | 6e 65 63 74 69 6f 6e 73 |imum con|nections|
|00001510| 20 79 6f 75 27 6c 6c 20 | 61 6c 6c 6f 77 20 28 30 | you'll |allow (0|
|00001520| 20 3d 20 75 6e 6c 69 6d | 69 74 65 64 29 22 29 3b | = unlim|ited)");|
|00001530| 0a 20 20 20 66 70 72 69 | 6e 74 66 28 66 2c 53 59 |. fpri|ntf(f,SY|
|00001540| 4e 54 41 58 2c 22 23 20 | 41 3a 22 2c 22 61 75 74 |NTAX,"# |A:","aut|
|00001550| 68 20 70 61 73 73 77 6f | 72 64 20 66 6f 72 20 69 |h passwo|rd for i|
|00001560| 6e 63 6f 6d 69 6e 67 20 | 63 6f 6e 6e 65 63 74 69 |ncoming |connecti|
|00001570| 6f 6e 73 22 29 3b 0a 20 | 20 20 66 70 72 69 6e 74 |ons");. | fprint|
|00001580| 66 28 66 2c 53 59 4e 54 | 41 58 2c 22 23 20 4f 3a |f(f,SYNT|AX,"# O:|
|00001590| 22 2c 22 6f 70 65 72 20 | 70 61 73 73 77 6f 72 64 |","oper |password|
|000015a0| 20 74 6f 20 65 6e 61 62 | 6c 65 20 4f 50 45 52 2c | to enab|le OPER,|
|000015b0| 20 57 48 4f 20 61 6e 64 | 20 4b 49 4c 4c 22 29 3b | WHO and| KILL");|
|000015c0| 0a 20 20 20 66 70 72 69 | 6e 74 66 28 66 2c 53 59 |. fpri|ntf(f,SY|
|000015d0| 4e 54 41 58 2c 22 23 20 | 43 3a 22 2c 22 63 6c 6f |NTAX,"# |C:","clo|
|000015e0| 61 6b 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 6e |ak the p|rogram n|
|000015f0| 61 6d 65 20 74 6f 20 73 | 68 6f 77 20 69 6e 20 61 |ame to s|how in a|
|00001600| 20 5c 22 70 73 5c 22 20 | 6c 69 73 74 69 6e 67 22 | \"ps\" |listing"|
|00001610| 29 3b 0a 20 20 20 66 70 | 72 69 6e 74 66 28 66 2c |);. fp|rintf(f,|
|00001620| 53 59 4e 54 41 58 2c 22 | 23 20 46 3a 22 2c 22 73 |SYNTAX,"|# F:","s|
|00001630| 70 65 63 69 66 79 20 74 | 68 65 20 69 64 65 6e 74 |pecify t|he ident|
|00001640| 20 73 70 6f 6f 66 20 66 | 69 6c 65 20 74 6f 20 77 | spoof f|ile to w|
|00001650| 72 69 74 65 20 74 6f 20 | 28 65 67 2e 20 2e 6e 6f |rite to |(eg. .no|
|00001660| 69 64 65 6e 74 2c 20 2e | 66 61 6b 65 69 64 29 22 |ident, .|fakeid)"|
|00001670| 29 3b 0a 20 20 20 66 70 | 72 69 6e 74 66 28 66 2c |);. fp|rintf(f,|
|00001680| 53 59 4e 54 41 58 2c 22 | 23 20 4c 3a 22 2c 22 73 |SYNTAX,"|# L:","s|
|00001690| 70 65 63 69 66 79 20 61 | 6e 20 61 6c 74 65 72 6e |pecify a|n altern|
|000016a0| 61 74 65 20 6c 6f 67 20 | 66 69 6c 65 20 28 64 65 |ate log |file (de|
|000016b0| 66 61 75 6c 74 3a 20 62 | 6e 63 2e 6c 6f 67 29 22 |fault: b|nc.log)"|
|000016c0| 29 3b 0a 20 20 20 66 70 | 72 69 6e 74 66 28 66 2c |);. fp|rintf(f,|
|000016d0| 53 59 4e 54 41 58 2c 22 | 23 20 5a 3a 22 2c 22 73 |SYNTAX,"|# Z:","s|
|000016e0| 70 65 63 69 66 79 20 61 | 6e 20 61 6c 74 65 72 6e |pecify a|n altern|
|000016f0| 61 74 65 20 70 69 64 20 | 66 69 6c 65 20 28 64 65 |ate pid |file (de|
|00001700| 66 61 75 6c 74 3a 20 62 | 6e 63 2e 70 69 64 29 5c |fault: b|nc.pid)\|
|00001710| 6e 22 29 3b 0a 0a 20 20 | 20 73 61 76 65 73 74 72 |n");.. | savestr|
|00001720| 28 22 48 22 2c 63 6f 6e | 66 2d 3e 6c 68 6f 73 74 |("H",con|f->lhost|
|00001730| 2c 22 6d 79 2e 6c 6f 63 | 61 6c 2e 68 6f 73 74 2e |,"my.loc|al.host.|
|00001740| 6f 72 67 22 2c 30 29 3b | 0a 20 20 20 73 61 76 65 |org",0);|. save|
|00001750| 69 6e 74 28 22 50 22 2c | 63 6f 6e 66 2d 3e 6c 70 |int("P",|conf->lp|
|00001760| 6f 72 74 2c 36 36 36 37 | 29 3b 0a 0a 20 20 20 69 |ort,6667|);.. i|
|00001770| 66 20 28 2a 63 6f 6e 66 | 2d 3e 76 68 6f 73 74 73 |f (*conf|->vhosts|
|00001780| 2e 68 6f 73 74 29 20 7b | 0a 20 20 20 20 20 20 76 |.host) {|. v|
|00001790| 68 6f 73 74 73 3d 26 63 | 6f 6e 66 2d 3e 76 68 6f |hosts=&c|onf->vho|
|000017a0| 73 74 73 3b 0a 20 20 20 | 20 20 20 77 68 69 6c 65 |sts;. | while|
|000017b0| 20 28 76 68 6f 73 74 73 | 21 3d 4e 55 4c 4c 29 20 | (vhosts|!=NULL) |
|000017c0| 7b 0a 20 20 20 20 20 20 | 20 20 20 66 70 72 69 6e |{. | fprin|
|000017d0| 74 66 28 66 2c 22 56 3a | 25 73 5c 6e 22 2c 76 68 |tf(f,"V:|%s\n",vh|
|000017e0| 6f 73 74 73 2d 3e 68 6f | 73 74 29 3b 0a 20 20 20 |osts->ho|st);. |
|000017f0| 20 20 20 20 20 20 76 68 | 6f 73 74 73 3d 76 68 6f | vh|osts=vho|
|00001800| 73 74 73 2d 3e 6e 65 78 | 74 3b 0a 20 20 20 20 20 |sts->nex|t;. |
|00001810| 20 7d 0a 20 20 20 7d 20 | 65 6c 73 65 20 66 70 72 | }. } |else fpr|
|00001820| 69 6e 74 66 28 66 2c 22 | 23 56 3a 6d 79 2e 76 69 |intf(f,"|#V:my.vi|
|00001830| 72 74 75 61 6c 2e 68 6f | 73 74 2e 6f 72 67 5c 6e |rtual.ho|st.org\n|
|00001840| 22 29 3b 0a 20 20 20 73 | 61 76 65 69 6e 74 28 22 |");. s|aveint("|
|00001850| 44 22 2c 63 6f 6e 66 2d | 3e 64 70 6f 72 74 2c 36 |D",conf-|>dport,6|
|00001860| 36 36 37 29 3b 0a 20 20 | 20 73 61 76 65 69 6e 74 |667);. | saveint|
|00001870| 28 22 4d 22 2c 63 6f 6e | 66 2d 3e 6d 61 78 75 73 |("M",con|f->maxus|
|00001880| 65 72 73 2c 31 30 30 29 | 3b 0a 20 20 20 73 61 76 |ers,100)|;. sav|
|00001890| 65 73 74 72 28 22 41 22 | 2c 63 6f 6e 66 2d 3e 70 |estr("A"|,conf->p|
|000018a0| 61 73 73 2c 22 6c 69 6d | 69 74 32 30 63 68 61 72 |ass,"lim|it20char|
|000018b0| 73 22 2c 30 29 3b 0a 20 | 20 20 73 61 76 65 73 74 |s",0);. | savest|
|000018c0| 72 28 22 4f 22 2c 63 6f | 6e 66 2d 3e 6f 70 65 72 |r("O",co|nf->oper|
|000018d0| 2c 22 6c 69 6d 69 74 32 | 30 63 68 61 72 73 22 2c |,"limit2|0chars",|
|000018e0| 30 29 3b 0a 20 20 20 73 | 61 76 65 73 74 72 28 22 |0);. s|avestr("|
|000018f0| 43 22 2c 63 6f 6e 66 2d | 3e 63 6c 6f 61 6b 2c 22 |C",conf-|>cloak,"|
|00001900| 65 6d 61 63 73 22 2c 30 | 29 3b 0a 20 20 20 73 61 |emacs",0|);. sa|
|00001910| 76 65 73 74 72 28 22 46 | 22 2c 63 6f 6e 66 2d 3e |vestr("F|",conf->|
|00001920| 66 61 6b 65 69 64 2c 22 | 2e 6e 6f 69 64 65 6e 74 |fakeid,"|.noident|
|00001930| 22 2c 30 29 3b 0a 20 20 | 20 73 61 76 65 73 74 72 |",0);. | savestr|
|00001940| 28 22 4c 22 2c 63 6f 6e | 66 2d 3e 6c 6f 67 66 69 |("L",con|f->logfi|
|00001950| 6c 65 2c 22 62 6e 63 2e | 6c 6f 67 22 2c 31 29 3b |le,"bnc.|log",1);|
|00001960| 0a 20 20 20 73 61 76 65 | 73 74 72 28 22 5a 22 2c |. save|str("Z",|
|00001970| 63 6f 6e 66 2d 3e 70 69 | 64 66 69 6c 65 2c 22 62 |conf->pi|dfile,"b|
|00001980| 6e 63 2e 70 69 64 22 2c | 31 29 3b 0a 20 20 20 66 |nc.pid",|1);. f|
|00001990| 63 6c 6f 73 65 28 66 29 | 3b 0a 7d 0a 00 00 00 00 |close(f)|;.}.....|
|000019a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a00| 69 62 6e 63 32 2e 30 61 | 2f 68 65 6c 70 2e 63 00 |ibnc2.0a|/help.c.|
|00001a10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a60| 00 00 00 00 31 30 30 36 | 30 30 20 00 20 20 20 20 |....1006|00 . |
|00001a70| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00001a80| 20 20 20 34 37 36 36 20 | 20 36 35 32 34 33 36 31 | 4766 | 6524361|
|00001a90| 32 30 37 20 20 31 31 36 | 30 36 00 20 30 00 00 00 |207 116|06. 0...|
|00001aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b00| 00 75 73 74 61 72 20 20 | 00 76 30 30 64 30 30 00 |.ustar |.v00d00.|
|00001b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b20| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00001b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c00| 2f 2a 0a 20 20 20 54 68 | 69 73 20 66 69 6c 65 20 |/*. Th|is file |
|00001c10| 69 73 20 70 61 72 74 20 | 6f 66 20 74 68 65 20 49 |is part |of the I|
|00001c20| 52 43 20 42 6f 75 6e 63 | 65 20 73 6f 75 72 63 65 |RC Bounc|e source|
|00001c30| 20 63 6f 64 65 0a 20 20 | 20 63 6f 70 79 72 69 67 | code. | copyrig|
|00001c40| 68 74 20 28 63 29 20 31 | 39 39 38 20 76 30 30 64 |ht (c) 1|998 v00d|
|00001c50| 30 30 20 4e 65 74 20 53 | 65 72 76 69 63 65 73 0a |00 Net S|ervices.|
|00001c60| 20 20 20 61 6e 64 20 69 | 73 20 64 69 73 74 72 69 | and i|s distri|
|00001c70| 62 75 74 65 64 20 61 63 | 63 6f 72 64 69 6e 67 20 |buted ac|cording |
|00001c80| 74 6f 20 74 68 65 20 47 | 4e 55 20 67 65 6e 65 72 |to the G|NU gener|
|00001c90| 61 6c 20 70 75 62 6c 69 | 63 20 6c 69 63 65 6e 73 |al publi|c licens|
|00001ca0| 65 2e 0a 0a 20 20 20 54 | 68 69 73 20 70 72 6f 67 |e... T|his prog|
|00001cb0| 72 61 6d 20 69 73 20 66 | 72 65 65 20 73 6f 66 74 |ram is f|ree soft|
|00001cc0| 77 61 72 65 3b 20 79 6f | 75 20 63 61 6e 20 72 65 |ware; yo|u can re|
|00001cd0| 64 69 73 74 72 69 62 75 | 74 65 20 69 74 20 61 6e |distribu|te it an|
|00001ce0| 64 2f 6f 72 20 6d 6f 64 | 69 66 79 0a 20 20 20 69 |d/or mod|ify. i|
|00001cf0| 74 20 75 6e 64 65 72 20 | 74 68 65 20 74 65 72 6d |t under |the term|
|00001d00| 73 20 6f 66 20 74 68 65 | 20 47 4e 55 20 47 65 6e |s of the| GNU Gen|
|00001d10| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|00001d20| 6e 73 65 20 61 73 20 70 | 75 62 6c 69 73 68 65 64 |nse as p|ublished|
|00001d30| 20 62 79 0a 20 20 20 74 | 68 65 20 46 72 65 65 20 | by. t|he Free |
|00001d40| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|00001d50| 69 6f 6e 3b 20 65 69 74 | 68 65 72 20 76 65 72 73 |ion; eit|her vers|
|00001d60| 69 6f 6e 20 32 20 6f 66 | 20 74 68 65 20 4c 69 63 |ion 2 of| the Lic|
|00001d70| 65 6e 73 65 2c 20 6f 72 | 0a 20 20 20 28 61 74 20 |ense, or|. (at |
|00001d80| 79 6f 75 72 20 6f 70 74 | 69 6f 6e 29 20 61 6e 79 |your opt|ion) any|
|00001d90| 20 6c 61 74 65 72 20 76 | 65 72 73 69 6f 6e 2e 0a | later v|ersion..|
|00001da0| 0a 20 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d |. This| program|
|00001db0| 20 69 73 20 64 69 73 74 | 72 69 62 75 74 65 64 20 | is dist|ributed |
|00001dc0| 69 6e 20 74 68 65 20 68 | 6f 70 65 20 74 68 61 74 |in the h|ope that|
|00001dd0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 75 73 65 66 | it will| be usef|
|00001de0| 75 6c 2c 0a 20 20 20 62 | 75 74 20 57 49 54 48 4f |ul,. b|ut WITHO|
|00001df0| 55 54 20 41 4e 59 20 57 | 41 52 52 41 4e 54 59 3b |UT ANY W|ARRANTY;|
|00001e00| 20 77 69 74 68 6f 75 74 | 20 65 76 65 6e 20 74 68 | without| even th|
|00001e10| 65 20 69 6d 70 6c 69 65 | 64 20 77 61 72 72 61 6e |e implie|d warran|
|00001e20| 74 79 20 6f 66 0a 20 20 | 20 4d 45 52 43 48 41 4e |ty of. | MERCHAN|
|00001e30| 54 41 42 49 4c 49 54 59 | 20 6f 72 20 46 49 54 4e |TABILITY| or FITN|
|00001e40| 45 53 53 20 46 4f 52 20 | 41 20 50 41 52 54 49 43 |ESS FOR |A PARTIC|
|00001e50| 55 4c 41 52 20 50 55 52 | 50 4f 53 45 2e 20 20 53 |ULAR PUR|POSE. S|
|00001e60| 65 65 20 74 68 65 0a 20 | 20 20 47 4e 55 20 47 65 |ee the. | GNU Ge|
|00001e70| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 20 4c 69 63 |neral Pu|blic Lic|
|00001e80| 65 6e 73 65 20 66 6f 72 | 20 6d 6f 72 65 20 64 65 |ense for| more de|
|00001e90| 74 61 69 6c 73 2e 0a 0a | 20 20 20 59 6f 75 20 73 |tails...| You s|
|00001ea0| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|00001eb0| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|00001ec0| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|00001ed0| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 0a 20 20 20 |blic Lic|ense. |
|00001ee0| 61 6c 6f 6e 67 20 77 69 | 74 68 20 74 68 69 73 20 |along wi|th this |
|00001ef0| 70 72 6f 67 72 61 6d 3b | 20 69 66 20 6e 6f 74 2c |program;| if not,|
|00001f00| 20 77 72 69 74 65 20 74 | 6f 20 74 68 65 20 46 72 | write t|o the Fr|
|00001f10| 65 65 20 53 6f 66 74 77 | 61 72 65 0a 20 20 20 46 |ee Softw|are. F|
|00001f20| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 2c |oundatio|n, Inc.,|
|00001f30| 20 36 37 35 20 4d 61 73 | 73 20 41 76 65 2c 20 43 | 675 Mas|s Ave, C|
|00001f40| 61 6d 62 72 69 64 67 65 | 2c 20 4d 41 20 30 32 31 |ambridge|, MA 021|
|00001f50| 33 39 2c 20 55 53 41 2e | 0a 0a 20 20 20 54 68 65 |39, USA.|.. The|
|00001f60| 20 61 75 74 68 6f 72 20 | 28 52 6f 62 65 72 74 20 | author |(Robert |
|00001f70| 43 6c 61 72 6b 29 20 63 | 61 6e 20 62 65 20 72 65 |Clark) c|an be re|
|00001f80| 61 63 68 65 64 20 61 74 | 3a 20 76 30 30 64 30 30 |ached at|: v00d00|
|00001f90| 40 68 65 6d 70 73 65 65 | 64 2e 63 6f 6d 0a 0a 20 |@hempsee|d.com.. |
|00001fa0| 20 20 54 68 69 73 20 63 | 6f 64 65 20 69 73 20 62 | This c|ode is b|
|00001fb0| 61 73 65 64 20 6f 6e 20 | 49 72 63 20 50 72 6f 78 |ased on |Irc Prox|
|00001fc0| 79 20 28 63 29 31 39 39 | 37 2d 39 38 20 4a 61 6d |y (c)199|7-98 Jam|
|00001fd0| 65 73 20 53 65 74 65 72 | 0a 2a 2f 0a 0a 23 69 6e |es Seter|.*/..#in|
|00001fe0| 63 6c 75 64 65 20 22 63 | 6f 6d 6d 6f 6e 2e 68 22 |clude "c|ommon.h"|
|00001ff0| 0a 0a 76 6f 69 64 0a 73 | 68 6f 77 5f 6c 69 63 65 |..void.s|how_lice|
|00002000| 6e 73 65 28 29 20 7b 0a | 20 20 20 70 72 69 6e 74 |nse() {.| print|
|00002010| 66 28 22 54 68 69 73 20 | 70 72 6f 67 72 61 6d 20 |f("This |program |
|00002020| 69 73 20 66 72 65 65 20 | 73 6f 66 74 77 61 72 65 |is free |software|
|00002030| 3b 20 79 6f 75 20 63 61 | 6e 20 72 65 64 69 73 74 |; you ca|n redist|
|00002040| 72 69 62 75 74 65 20 69 | 74 20 61 6e 64 2f 6f 72 |ribute i|t and/or|
|00002050| 20 6d 6f 64 69 66 79 5c | 6e 22 29 3b 0a 20 20 20 | modify\|n");. |
|00002060| 70 72 69 6e 74 66 28 22 | 69 74 20 75 6e 64 65 72 |printf("|it under|
|00002070| 20 74 68 65 20 74 65 72 | 6d 73 20 6f 66 20 74 68 | the ter|ms of th|
|00002080| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|00002090| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 20 61 73 20 |blic Lic|ense as |
|000020a0| 70 75 62 6c 69 73 68 65 | 64 20 62 79 5c 6e 22 29 |publishe|d by\n")|
|000020b0| 3b 0a 20 20 20 70 72 69 | 6e 74 66 28 22 74 68 65 |;. pri|ntf("the|
|000020c0| 20 46 72 65 65 20 53 6f | 66 74 77 61 72 65 20 46 | Free So|ftware F|
|000020d0| 6f 75 6e 64 61 74 69 6f | 6e 3b 20 65 69 74 68 65 |oundatio|n; eithe|
|000020e0| 72 20 76 65 72 73 69 6f | 6e 20 32 20 6f 66 20 74 |r versio|n 2 of t|
|000020f0| 68 65 20 4c 69 63 65 6e | 73 65 2c 20 6f 72 5c 6e |he Licen|se, or\n|
|00002100| 22 29 3b 0a 20 20 20 70 | 72 69 6e 74 66 28 22 28 |");. p|rintf("(|
|00002110| 61 74 20 79 6f 75 72 20 | 6f 70 74 69 6f 6e 29 20 |at your |option) |
|00002120| 61 6e 79 20 6c 61 74 65 | 72 20 76 65 72 73 69 6f |any late|r versio|
|00002130| 6e 2e 5c 6e 5c 6e 22 29 | 3b 0a 20 20 20 70 72 69 |n.\n\n")|;. pri|
|00002140| 6e 74 66 28 22 54 68 69 | 73 20 70 72 6f 67 72 61 |ntf("Thi|s progra|
|00002150| 6d 20 69 73 20 64 69 73 | 74 72 69 62 75 74 65 64 |m is dis|tributed|
|00002160| 20 69 6e 20 74 68 65 20 | 68 6f 70 65 20 74 68 61 | in the |hope tha|
|00002170| 74 20 69 74 20 77 69 6c | 6c 20 62 65 20 75 73 65 |t it wil|l be use|
|00002180| 66 75 6c 2c 5c 6e 22 29 | 3b 0a 20 20 20 70 72 69 |ful,\n")|;. pri|
|00002190| 6e 74 66 28 22 62 75 74 | 20 57 49 54 48 4f 55 54 |ntf("but| WITHOUT|
|000021a0| 20 41 4e 59 20 57 41 52 | 52 41 4e 54 59 3b 20 77 | ANY WAR|RANTY; w|
|000021b0| 69 74 68 6f 75 74 20 65 | 76 65 6e 20 74 68 65 20 |ithout e|ven the |
|000021c0| 69 6d 70 6c 69 65 64 20 | 77 61 72 72 61 6e 74 79 |implied |warranty|
|000021d0| 20 6f 66 5c 6e 22 29 3b | 0a 20 20 20 70 72 69 6e | of\n");|. prin|
|000021e0| 74 66 28 22 4d 45 52 43 | 48 41 4e 54 41 42 49 4c |tf("MERC|HANTABIL|
|000021f0| 49 54 59 20 6f 72 20 46 | 49 54 4e 45 53 53 20 46 |ITY or F|ITNESS F|
|00002200| 4f 52 20 41 20 50 41 52 | 54 49 43 55 4c 41 52 20 |OR A PAR|TICULAR |
|00002210| 50 55 52 50 4f 53 45 2e | 20 20 53 65 65 20 74 68 |PURPOSE.| See th|
|00002220| 65 5c 6e 22 29 3b 0a 20 | 20 20 70 72 69 6e 74 66 |e\n");. | printf|
|00002230| 28 22 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |("GNU Ge|neral Pu|
|00002240| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 20 66 6f 72 |blic Lic|ense for|
|00002250| 20 6d 6f 72 65 20 64 65 | 74 61 69 6c 73 2e 5c 6e | more de|tails.\n|
|00002260| 5c 6e 22 29 3b 0a 20 20 | 20 70 72 69 6e 74 66 28 |\n");. | printf(|
|00002270| 22 59 6f 75 20 73 68 6f | 75 6c 64 20 68 61 76 65 |"You sho|uld have|
|00002280| 20 72 65 63 65 69 76 65 | 64 20 61 20 63 6f 70 79 | receive|d a copy|
|00002290| 20 6f 66 20 74 68 65 20 | 47 4e 55 20 47 65 6e 65 | of the |GNU Gene|
|000022a0| 72 61 6c 20 50 75 62 6c | 69 63 20 4c 69 63 65 6e |ral Publ|ic Licen|
|000022b0| 73 65 5c 6e 22 29 3b 0a | 20 20 20 70 72 69 6e 74 |se\n");.| print|
|000022c0| 66 28 22 61 6c 6f 6e 67 | 20 77 69 74 68 20 74 68 |f("along| with th|
|000022d0| 69 73 20 70 72 6f 67 72 | 61 6d 3b 20 69 66 20 6e |is progr|am; if n|
|000022e0| 6f 74 2c 20 77 72 69 74 | 65 20 74 6f 20 74 68 65 |ot, writ|e to the|
|000022f0| 20 46 72 65 65 20 53 6f | 66 74 77 61 72 65 5c 6e | Free So|ftware\n|
|00002300| 22 29 3b 0a 20 20 20 70 | 72 69 6e 74 66 28 22 46 |");. p|rintf("F|
|00002310| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 2c |oundatio|n, Inc.,|
|00002320| 20 36 37 35 20 4d 61 73 | 73 20 41 76 65 2c 20 43 | 675 Mas|s Ave, C|
|00002330| 61 6d 62 72 69 64 67 65 | 2c 20 4d 41 20 30 32 31 |ambridge|, MA 021|
|00002340| 33 39 2c 20 55 53 41 2e | 5c 6e 5c 6e 22 29 3b 0a |39, USA.|\n\n");.|
|00002350| 7d 0a 0a 76 6f 69 64 0a | 73 68 6f 77 5f 68 65 6c |}..void.|show_hel|
|00002360| 70 28 63 68 61 72 20 2a | 50 72 6f 67 4e 61 6d 65 |p(char *|ProgName|
|00002370| 29 20 7b 0a 20 20 20 70 | 72 69 6e 74 66 28 22 55 |) {. p|rintf("U|
|00002380| 73 61 67 65 3a 20 25 73 | 20 5b 20 2d 63 20 3c 66 |sage: %s| [ -c <f|
|00002390| 69 6c 65 6e 61 6d 65 3e | 20 7c 20 2d 69 20 7c 20 |ilename>| | -i | |
|000023a0| 2d 66 20 7c 20 2d 6c 20 | 7c 20 2d 76 20 7c 20 2d |-f | -l || -v | -|
|000023b0| 68 20 5d 5c 6e 5c 6e 22 | 2c 50 72 6f 67 4e 61 6d |h ]\n\n"|,ProgNam|
|000023c0| 65 29 3b 0a 20 20 20 70 | 72 69 6e 74 66 28 22 20 |e);. p|rintf(" |
|000023d0| 20 2d 63 20 3a 20 53 70 | 65 63 69 66 79 20 61 6e | -c : Sp|ecify an|
|000023e0| 20 61 6c 74 65 72 6e 61 | 74 65 20 63 6f 6e 66 69 | alterna|te confi|
|000023f0| 67 20 66 69 6c 65 20 74 | 6f 20 6c 6f 61 64 5c 6e |g file t|o load\n|
|00002400| 22 29 3b 0a 20 20 20 70 | 72 69 6e 74 66 28 22 20 |");. p|rintf(" |
|00002410| 20 2d 69 20 3a 20 4c 6f | 61 64 20 28 69 66 20 70 | -i : Lo|ad (if p|
|00002420| 6f 73 73 69 62 6c 65 29 | 20 61 6e 64 20 73 61 76 |ossible)| and sav|
|00002430| 65 20 74 68 65 20 63 6f | 6e 66 69 67 75 72 61 74 |e the co|nfigurat|
|00002440| 69 6f 6e 20 66 69 6c 65 | 5c 6e 22 29 3b 0a 20 20 |ion file|\n");. |
|00002450| 20 70 72 69 6e 74 66 28 | 22 20 20 2d 66 20 3a 20 | printf(|" -f : |
|00002460| 4f 76 65 72 77 72 69 74 | 65 20 74 68 65 20 63 6f |Overwrit|e the co|
|00002470| 6e 66 69 67 75 72 61 74 | 69 6f 6e 20 66 69 6c 65 |nfigurat|ion file|
|00002480| 20 77 69 74 68 20 74 68 | 65 20 64 65 66 61 75 6c | with th|e defaul|
|00002490| 74 20 6f 6e 65 5c 6e 22 | 29 3b 0a 20 20 20 70 72 |t one\n"|);. pr|
|000024a0| 69 6e 74 66 28 22 20 20 | 2d 6c 20 3a 20 44 69 73 |intf(" |-l : Dis|
|000024b0| 70 6c 61 79 20 74 68 65 | 20 47 4e 55 20 47 65 6e |play the| GNU Gen|
|000024c0| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|000024d0| 6e 73 65 5c 6e 22 29 3b | 0a 20 20 20 70 72 69 6e |nse\n");|. prin|
|000024e0| 74 66 28 22 20 20 2d 76 | 20 3a 20 44 69 73 70 6c |tf(" -v| : Displ|
|000024f0| 61 79 20 76 65 72 73 69 | 6f 6e 20 69 6e 66 6f 72 |ay versi|on infor|
|00002500| 6d 61 74 69 6f 6e 5c 6e | 22 29 3b 0a 20 20 20 70 |mation\n|");. p|
|00002510| 72 69 6e 74 66 28 22 20 | 20 2d 68 20 3a 20 54 68 |rintf(" | -h : Th|
|00002520| 69 73 20 68 65 6c 70 20 | 73 63 72 65 65 6e 5c 6e |is help |screen\n|
|00002530| 5c 6e 22 29 3b 0a 20 20 | 20 70 72 69 6e 74 66 28 |\n");. | printf(|
|00002540| 22 4e 6f 74 65 3a 20 55 | 73 69 6e 67 20 61 6e 79 |"Note: U|sing any|
|00002550| 20 6f 66 20 74 68 65 20 | 61 62 6f 76 65 20 63 6f | of the |above co|
|00002560| 6d 6d 61 6e 64 20 6c 69 | 6e 65 20 6f 70 74 69 6f |mmand li|ne optio|
|00002570| 6e 73 20 72 65 73 75 6c | 74 73 5c 6e 22 29 3b 0a |ns resul|ts\n");.|
|00002580| 20 20 20 70 72 69 6e 74 | 66 28 22 20 20 20 20 20 | print|f(" |
|00002590| 20 69 6e 20 74 68 65 20 | 62 6f 75 6e 63 65 72 20 | in the |bouncer |
|000025a0| 65 78 69 74 69 6e 67 20 | 61 73 20 73 6f 6f 6e 20 |exiting |as soon |
|000025b0| 61 73 20 74 68 65 20 73 | 70 65 63 69 66 69 65 64 |as the s|pecified|
|000025c0| 5c 6e 22 29 3b 0a 20 20 | 20 70 72 69 6e 74 66 28 |\n");. | printf(|
|000025d0| 22 20 20 20 20 20 20 66 | 75 6e 63 74 69 6f 6e 20 |" f|unction |
|000025e0| 69 73 20 63 6f 6d 70 6c | 65 74 65 2e 5c 6e 5c 6e |is compl|ete.\n\n|
|000025f0| 22 29 3b 0a 7d 0a 00 00 | 00 00 00 00 00 00 00 00 |");.}...|........|
|00002600| 69 62 6e 63 32 2e 30 61 | 2f 6e 65 74 2e 63 00 00 |ibnc2.0a|/net.c..|
|00002610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002660| 00 00 00 00 31 30 30 36 | 30 30 20 00 20 20 20 20 |....1006|00 . |
|00002670| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00002680| 20 20 20 34 37 35 35 20 | 20 36 35 32 34 33 36 31 | 4755 | 6524361|
|00002690| 32 30 37 20 20 31 31 34 | 34 32 00 20 30 00 00 00 |207 114|42. 0...|
|000026a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002700| 00 75 73 74 61 72 20 20 | 00 76 30 30 64 30 30 00 |.ustar |.v00d00.|
|00002710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002720| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00002730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002800| 2f 2a 0a 20 20 20 54 68 | 69 73 20 66 69 6c 65 20 |/*. Th|is file |
|00002810| 69 73 20 70 61 72 74 20 | 6f 66 20 74 68 65 20 49 |is part |of the I|
|00002820| 52 43 20 42 6f 75 6e 63 | 65 20 73 6f 75 72 63 65 |RC Bounc|e source|
|00002830| 20 63 6f 64 65 0a 20 20 | 20 63 6f 70 79 72 69 67 | code. | copyrig|
|00002840| 68 74 20 28 63 29 20 31 | 39 39 38 20 76 30 30 64 |ht (c) 1|998 v00d|
|00002850| 30 30 20 4e 65 74 20 53 | 65 72 76 69 63 65 73 0a |00 Net S|ervices.|
|00002860| 20 20 20 61 6e 64 20 69 | 73 20 64 69 73 74 72 69 | and i|s distri|
|00002870| 62 75 74 65 64 20 61 63 | 63 6f 72 64 69 6e 67 20 |buted ac|cording |
|00002880| 74 6f 20 74 68 65 20 47 | 4e 55 20 67 65 6e 65 72 |to the G|NU gener|
|00002890| 61 6c 20 70 75 62 6c 69 | 63 20 6c 69 63 65 6e 73 |al publi|c licens|
|000028a0| 65 2e 0a 0a 20 20 20 54 | 68 69 73 20 70 72 6f 67 |e... T|his prog|
|000028b0| 72 61 6d 20 69 73 20 66 | 72 65 65 20 73 6f 66 74 |ram is f|ree soft|
|000028c0| 77 61 72 65 3b 20 79 6f | 75 20 63 61 6e 20 72 65 |ware; yo|u can re|
|000028d0| 64 69 73 74 72 69 62 75 | 74 65 20 69 74 20 61 6e |distribu|te it an|
|000028e0| 64 2f 6f 72 20 6d 6f 64 | 69 66 79 0a 20 20 20 69 |d/or mod|ify. i|
|000028f0| 74 20 75 6e 64 65 72 20 | 74 68 65 20 74 65 72 6d |t under |the term|
|00002900| 73 20 6f 66 20 74 68 65 | 20 47 4e 55 20 47 65 6e |s of the| GNU Gen|
|00002910| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|00002920| 6e 73 65 20 61 73 20 70 | 75 62 6c 69 73 68 65 64 |nse as p|ublished|
|00002930| 20 62 79 0a 20 20 20 74 | 68 65 20 46 72 65 65 20 | by. t|he Free |
|00002940| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|00002950| 69 6f 6e 3b 20 65 69 74 | 68 65 72 20 76 65 72 73 |ion; eit|her vers|
|00002960| 69 6f 6e 20 32 20 6f 66 | 20 74 68 65 20 4c 69 63 |ion 2 of| the Lic|
|00002970| 65 6e 73 65 2c 20 6f 72 | 0a 20 20 20 28 61 74 20 |ense, or|. (at |
|00002980| 79 6f 75 72 20 6f 70 74 | 69 6f 6e 29 20 61 6e 79 |your opt|ion) any|
|00002990| 20 6c 61 74 65 72 20 76 | 65 72 73 69 6f 6e 2e 0a | later v|ersion..|
|000029a0| 0a 20 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d |. This| program|
|000029b0| 20 69 73 20 64 69 73 74 | 72 69 62 75 74 65 64 20 | is dist|ributed |
|000029c0| 69 6e 20 74 68 65 20 68 | 6f 70 65 20 74 68 61 74 |in the h|ope that|
|000029d0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 75 73 65 66 | it will| be usef|
|000029e0| 75 6c 2c 0a 20 20 20 62 | 75 74 20 57 49 54 48 4f |ul,. b|ut WITHO|
|000029f0| 55 54 20 41 4e 59 20 57 | 41 52 52 41 4e 54 59 3b |UT ANY W|ARRANTY;|
|00002a00| 20 77 69 74 68 6f 75 74 | 20 65 76 65 6e 20 74 68 | without| even th|
|00002a10| 65 20 69 6d 70 6c 69 65 | 64 20 77 61 72 72 61 6e |e implie|d warran|
|00002a20| 74 79 20 6f 66 0a 20 20 | 20 4d 45 52 43 48 41 4e |ty of. | MERCHAN|
|00002a30| 54 41 42 49 4c 49 54 59 | 20 6f 72 20 46 49 54 4e |TABILITY| or FITN|
|00002a40| 45 53 53 20 46 4f 52 20 | 41 20 50 41 52 54 49 43 |ESS FOR |A PARTIC|
|00002a50| 55 4c 41 52 20 50 55 52 | 50 4f 53 45 2e 20 20 53 |ULAR PUR|POSE. S|
|00002a60| 65 65 20 74 68 65 0a 20 | 20 20 47 4e 55 20 47 65 |ee the. | GNU Ge|
|00002a70| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 20 4c 69 63 |neral Pu|blic Lic|
|00002a80| 65 6e 73 65 20 66 6f 72 | 20 6d 6f 72 65 20 64 65 |ense for| more de|
|00002a90| 74 61 69 6c 73 2e 0a 0a | 20 20 20 59 6f 75 20 73 |tails...| You s|
|00002aa0| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|00002ab0| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|00002ac0| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|00002ad0| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 0a 20 20 20 |blic Lic|ense. |
|00002ae0| 61 6c 6f 6e 67 20 77 69 | 74 68 20 74 68 69 73 20 |along wi|th this |
|00002af0| 70 72 6f 67 72 61 6d 3b | 20 69 66 20 6e 6f 74 2c |program;| if not,|
|00002b00| 20 77 72 69 74 65 20 74 | 6f 20 74 68 65 20 46 72 | write t|o the Fr|
|00002b10| 65 65 20 53 6f 66 74 77 | 61 72 65 0a 20 20 20 46 |ee Softw|are. F|
|00002b20| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 2c |oundatio|n, Inc.,|
|00002b30| 20 36 37 35 20 4d 61 73 | 73 20 41 76 65 2c 20 43 | 675 Mas|s Ave, C|
|00002b40| 61 6d 62 72 69 64 67 65 | 2c 20 4d 41 20 30 32 31 |ambridge|, MA 021|
|00002b50| 33 39 2c 20 55 53 41 2e | 0a 0a 20 20 20 54 68 65 |39, USA.|.. The|
|00002b60| 20 61 75 74 68 6f 72 20 | 28 52 6f 62 65 72 74 20 | author |(Robert |
|00002b70| 43 6c 61 72 6b 29 20 63 | 61 6e 20 62 65 20 72 65 |Clark) c|an be re|
|00002b80| 61 63 68 65 64 20 61 74 | 3a 20 76 30 30 64 30 30 |ached at|: v00d00|
|00002b90| 40 68 65 6d 70 73 65 65 | 64 2e 63 6f 6d 0a 0a 20 |@hempsee|d.com.. |
|00002ba0| 20 20 54 68 69 73 20 63 | 6f 64 65 20 69 73 20 62 | This c|ode is b|
|00002bb0| 61 73 65 64 20 6f 6e 20 | 49 72 63 20 50 72 6f 78 |ased on |Irc Prox|
|00002bc0| 79 20 28 63 29 31 39 39 | 37 2d 39 38 20 4a 61 6d |y (c)199|7-98 Jam|
|00002bd0| 65 73 20 53 65 74 65 72 | 0a 2a 2f 0a 0a 23 69 6e |es Seter|.*/..#in|
|00002be0| 63 6c 75 64 65 20 22 63 | 6f 6d 6d 6f 6e 2e 68 22 |clude "c|ommon.h"|
|00002bf0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 61 72 70 61 2f |.#includ|e <arpa/|
|00002c00| 69 6e 65 74 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |inet.h>.|#include|
|00002c10| 20 3c 6e 65 74 64 62 2e | 68 3e 0a 23 69 6e 63 6c | <netdb.|h>.#incl|
|00002c20| 75 64 65 20 3c 6e 65 74 | 69 6e 65 74 2f 69 6e 2e |ude <net|inet/in.|
|00002c30| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |h>.#incl|ude <std|
|00002c40| 61 72 67 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |arg.h>.#|include |
|00002c50| 3c 73 79 73 2f 73 6f 63 | 6b 65 74 2e 68 3e 0a 23 |<sys/soc|ket.h>.#|
|00002c60| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 79 70 |include |<sys/typ|
|00002c70| 65 73 2e 68 3e 0a 0a 76 | 6f 69 64 0a 6e 70 72 69 |es.h>..v|oid.npri|
|00002c80| 6e 74 66 28 69 6e 74 20 | 73 2c 20 63 68 61 72 20 |ntf(int |s, char |
|00002c90| 2a 66 6f 72 6d 61 74 2c | 20 2e 2e 2e 29 0a 7b 0a |*format,| ...).{.|
|00002ca0| 20 20 20 76 61 5f 6c 69 | 73 74 20 76 61 3b 20 63 | va_li|st va; c|
|00002cb0| 68 61 72 20 62 75 66 66 | 65 72 5b 31 30 32 34 5d |har buff|er[1024]|
|00002cc0| 3b 20 69 6e 74 20 72 65 | 74 76 61 6c 3b 0a 20 20 |; int re|tval;. |
|00002cd0| 20 76 61 5f 73 74 61 72 | 74 28 76 61 2c 66 6f 72 | va_star|t(va,for|
|00002ce0| 6d 61 74 29 3b 20 76 73 | 6e 70 72 69 6e 74 66 28 |mat); vs|nprintf(|
|00002cf0| 62 75 66 66 65 72 2c 31 | 30 32 34 2c 66 6f 72 6d |buffer,1|024,form|
|00002d00| 61 74 2c 76 61 29 3b 20 | 76 61 5f 65 6e 64 28 76 |at,va); |va_end(v|
|00002d10| 61 29 3b 0a 20 20 20 73 | 65 6e 64 28 73 2c 62 75 |a);. s|end(s,bu|
|00002d20| 66 66 65 72 2c 73 74 72 | 6c 65 6e 28 62 75 66 66 |ffer,str|len(buff|
|00002d30| 65 72 29 2c 30 29 3b 0a | 7d 0a 0a 69 6e 74 0a 64 |er),0);.|}..int.d|
|00002d40| 6f 5f 63 6f 6e 6e 65 63 | 74 28 63 68 61 72 20 2a |o_connec|t(char *|
|00002d50| 76 68 6f 73 74 6e 61 6d | 65 2c 20 63 68 61 72 20 |vhostnam|e, char |
|00002d60| 2a 68 6f 73 74 6e 61 6d | 65 2c 20 75 5f 73 68 6f |*hostnam|e, u_sho|
|00002d70| 72 74 20 70 6f 72 74 29 | 0a 7b 0a 20 20 20 69 6e |rt port)|.{. in|
|00002d80| 74 20 73 3b 0a 20 20 20 | 73 74 72 75 63 74 20 68 |t s;. |struct h|
|00002d90| 6f 73 74 65 6e 74 20 2a | 68 65 3b 0a 20 20 20 73 |ostent *|he;. s|
|00002da0| 74 72 75 63 74 20 73 6f | 63 6b 61 64 64 72 5f 69 |truct so|ckaddr_i|
|00002db0| 6e 20 73 69 6e 3b 0a 0a | 20 20 20 73 3d 73 6f 63 |n sin;..| s=soc|
|00002dc0| 6b 65 74 28 41 46 5f 49 | 4e 45 54 2c 53 4f 43 4b |ket(AF_I|NET,SOCK|
|00002dd0| 5f 53 54 52 45 41 4d 2c | 30 29 3b 0a 20 20 20 69 |_STREAM,|0);. i|
|00002de0| 66 20 28 73 3c 30 29 20 | 72 65 74 75 72 6e 20 2d |f (s<0) |return -|
|00002df0| 32 3b 0a 20 20 20 6d 65 | 6d 73 65 74 28 26 73 69 |2;. me|mset(&si|
|00002e00| 6e 2c 30 2c 73 69 7a 65 | 6f 66 28 73 74 72 75 63 |n,0,size|of(struc|
|00002e10| 74 20 73 6f 63 6b 61 64 | 64 72 5f 69 6e 29 29 3b |t sockad|dr_in));|
|00002e20| 0a 20 20 20 73 69 6e 2e | 73 69 6e 5f 66 61 6d 69 |. sin.|sin_fami|
|00002e30| 6c 79 3d 41 46 5f 49 4e | 45 54 3b 0a 20 20 20 73 |ly=AF_IN|ET;. s|
|00002e40| 69 6e 2e 73 69 6e 5f 61 | 64 64 72 2e 73 5f 61 64 |in.sin_a|ddr.s_ad|
|00002e50| 64 72 3d 28 2a 76 68 6f | 73 74 6e 61 6d 65 3f 69 |dr=(*vho|stname?i|
|00002e60| 6e 65 74 5f 61 64 64 72 | 28 76 68 6f 73 74 6e 61 |net_addr|(vhostna|
|00002e70| 6d 65 29 3a 49 4e 41 44 | 44 52 5f 41 4e 59 29 3b |me):INAD|DR_ANY);|
|00002e80| 0a 20 20 20 69 66 20 28 | 73 69 6e 2e 73 69 6e 5f |. if (|sin.sin_|
|00002e90| 61 64 64 72 2e 73 5f 61 | 64 64 72 3d 3d 2d 31 26 |addr.s_a|ddr==-1&|
|00002ea0| 26 2a 76 68 6f 73 74 6e | 61 6d 65 29 20 7b 0a 20 |&*vhostn|ame) {. |
|00002eb0| 20 20 20 20 20 68 65 3d | 67 65 74 68 6f 73 74 62 | he=|gethostb|
|00002ec0| 79 6e 61 6d 65 28 76 68 | 6f 73 74 6e 61 6d 65 29 |yname(vh|ostname)|
|00002ed0| 3b 0a 20 20 20 20 20 20 | 69 66 28 68 65 29 20 6d |;. |if(he) m|
|00002ee0| 65 6d 63 70 79 28 26 73 | 69 6e 2e 73 69 6e 5f 61 |emcpy(&s|in.sin_a|
|00002ef0| 64 64 72 2c 68 65 2d 3e | 68 5f 61 64 64 72 2c 68 |ddr,he->|h_addr,h|
|00002f00| 65 2d 3e 68 5f 6c 65 6e | 67 74 68 29 3b 0a 20 20 |e->h_len|gth);. |
|00002f10| 20 20 20 20 65 6c 73 65 | 20 73 69 6e 2e 73 69 6e | else| sin.sin|
|00002f20| 5f 61 64 64 72 2e 73 5f | 61 64 64 72 3d 20 49 4e |_addr.s_|addr= IN|
|00002f30| 41 44 44 52 5f 41 4e 59 | 3b 0a 20 20 20 7d 0a 20 |ADDR_ANY|;. }. |
|00002f40| 20 20 69 66 20 28 62 69 | 6e 64 28 73 2c 28 73 74 | if (bi|nd(s,(st|
|00002f50| 72 75 63 74 20 73 6f 63 | 6b 61 64 64 72 20 2a 29 |ruct soc|kaddr *)|
|00002f60| 26 73 69 6e 2c 73 69 7a | 65 6f 66 28 73 74 72 75 |&sin,siz|eof(stru|
|00002f70| 63 74 20 73 6f 63 6b 61 | 64 64 72 5f 69 6e 29 29 |ct socka|ddr_in))|
|00002f80| 3c 30 29 20 72 65 74 75 | 72 6e 20 2d 31 3b 0a 0a |<0) retu|rn -1;..|
|00002f90| 20 20 20 6d 65 6d 73 65 | 74 28 26 73 69 6e 2c 30 | memse|t(&sin,0|
|00002fa0| 2c 73 69 7a 65 6f 66 28 | 73 74 72 75 63 74 20 73 |,sizeof(|struct s|
|00002fb0| 6f 63 6b 61 64 64 72 5f | 69 6e 29 29 3b 0a 20 20 |ockaddr_|in));. |
|00002fc0| 20 73 69 6e 2e 73 69 6e | 5f 66 61 6d 69 6c 79 3d | sin.sin|_family=|
|00002fd0| 41 46 5f 49 4e 45 54 3b | 0a 20 20 20 73 69 6e 2e |AF_INET;|. sin.|
|00002fe0| 73 69 6e 5f 70 6f 72 74 | 3d 68 74 6f 6e 73 28 70 |sin_port|=htons(p|
|00002ff0| 6f 72 74 29 3b 0a 20 20 | 20 73 69 6e 2e 73 69 6e |ort);. | sin.sin|
|00003000| 5f 61 64 64 72 2e 73 5f | 61 64 64 72 3d 69 6e 65 |_addr.s_|addr=ine|
|00003010| 74 5f 61 64 64 72 28 68 | 6f 73 74 6e 61 6d 65 29 |t_addr(h|ostname)|
|00003020| 3b 0a 20 20 20 69 66 20 | 28 73 69 6e 2e 73 69 6e |;. if |(sin.sin|
|00003030| 5f 61 64 64 72 2e 73 5f | 61 64 64 72 3d 3d 2d 31 |_addr.s_|addr==-1|
|00003040| 29 20 7b 0a 20 20 20 20 | 20 20 68 65 3d 67 65 74 |) {. | he=get|
|00003050| 68 6f 73 74 62 79 6e 61 | 6d 65 28 68 6f 73 74 6e |hostbyna|me(hostn|
|00003060| 61 6d 65 29 3b 0a 20 20 | 20 20 20 20 69 66 20 28 |ame);. | if (|
|00003070| 21 68 65 29 20 72 65 74 | 75 72 6e 20 2d 32 3b 0a |!he) ret|urn -2;.|
|00003080| 20 20 20 20 20 20 6d 65 | 6d 63 70 79 28 26 73 69 | me|mcpy(&si|
|00003090| 6e 2e 73 69 6e 5f 61 64 | 64 72 2c 68 65 2d 3e 68 |n.sin_ad|dr,he->h|
|000030a0| 5f 61 64 64 72 2c 68 65 | 2d 3e 68 5f 6c 65 6e 67 |_addr,he|->h_leng|
|000030b0| 74 68 29 3b 0a 20 20 20 | 7d 0a 0a 20 20 20 69 66 |th);. |}.. if|
|000030c0| 20 28 63 6f 6e 6e 65 63 | 74 28 73 2c 28 73 74 72 | (connec|t(s,(str|
|000030d0| 75 63 74 20 73 6f 63 6b | 61 64 64 72 20 2a 29 26 |uct sock|addr *)&|
|000030e0| 73 69 6e 2c 73 69 7a 65 | 6f 66 28 73 69 6e 29 29 |sin,size|of(sin))|
|000030f0| 3c 30 29 20 7b 0a 20 20 | 20 20 20 20 63 6c 6f 73 |<0) {. | clos|
|00003100| 65 28 73 29 3b 0a 20 20 | 20 20 20 20 72 65 74 75 |e(s);. | retu|
|00003110| 72 6e 20 2d 32 3b 0a 20 | 20 20 7d 0a 20 20 20 72 |rn -2;. | }. r|
|00003120| 65 74 75 72 6e 20 73 3b | 0a 7d 0a 0a 63 68 61 72 |eturn s;|.}..char|
|00003130| 20 2a 0a 67 65 74 68 6f | 73 74 28 73 74 72 75 63 | *.getho|st(struc|
|00003140| 74 20 69 6e 5f 61 64 64 | 72 20 2a 61 64 64 72 29 |t in_add|r *addr)|
|00003150| 0a 7b 0a 20 20 20 73 74 | 72 75 63 74 20 68 6f 73 |.{. st|ruct hos|
|00003160| 74 65 6e 74 20 2a 68 70 | 3b 0a 20 20 20 68 70 3d |tent *hp|;. hp=|
|00003170| 67 65 74 68 6f 73 74 62 | 79 61 64 64 72 28 28 63 |gethostb|yaddr((c|
|00003180| 68 61 72 20 2a 29 61 64 | 64 72 2c 73 69 7a 65 6f |har *)ad|dr,sizeo|
|00003190| 66 28 73 74 72 75 63 74 | 20 69 6e 5f 61 64 64 72 |f(struct| in_addr|
|000031a0| 29 2c 41 46 5f 49 4e 45 | 54 29 3b 0a 20 20 20 69 |),AF_INE|T);. i|
|000031b0| 66 20 28 68 70 29 20 72 | 65 74 75 72 6e 20 68 70 |f (hp) r|eturn hp|
|000031c0| 2d 3e 68 5f 6e 61 6d 65 | 3b 0a 20 20 20 65 6c 73 |->h_name|;. els|
|000031d0| 65 20 72 65 74 75 72 6e | 20 69 6e 65 74 5f 6e 74 |e return| inet_nt|
|000031e0| 6f 61 28 2a 61 64 64 72 | 29 3b 0a 7d 0a 00 00 00 |oa(*addr|);.}....|
|000031f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003200| 69 62 6e 63 32 2e 30 61 | 2f 63 6f 6d 6d 6f 6e 2e |ibnc2.0a|/common.|
|00003210| 68 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |h.......|........|
|00003220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003260| 00 00 00 00 31 30 30 36 | 30 30 20 00 20 20 20 20 |....1006|00 . |
|00003270| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00003280| 20 20 20 31 33 37 32 20 | 20 36 35 32 34 33 36 31 | 1372 | 6524361|
|00003290| 32 30 37 20 20 31 32 31 | 34 31 00 20 30 00 00 00 |207 121|41. 0...|
|000032a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003300| 00 75 73 74 61 72 20 20 | 00 76 30 30 64 30 30 00 |.ustar |.v00d00.|
|00003310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003320| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00003330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003400| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00003410| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |h>.#incl|ude <std|
|00003420| 6c 69 62 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |lib.h>.#|include |
|00003430| 3c 73 74 72 69 6e 67 2e | 68 3e 0a 23 69 6e 63 6c |<string.|h>.#incl|
|00003440| 75 64 65 20 3c 73 69 67 | 6e 61 6c 2e 68 3e 0a 23 |ude <sig|nal.h>.#|
|00003450| 69 6e 63 6c 75 64 65 20 | 3c 65 72 72 6e 6f 2e 68 |include |<errno.h|
|00003460| 3e 0a 0a 23 64 65 66 69 | 6e 65 20 48 4f 53 54 4c |>..#defi|ne HOSTL|
|00003470| 45 4e 20 31 32 31 0a 23 | 64 65 66 69 6e 65 20 50 |EN 121.#|define P|
|00003480| 41 53 53 4c 45 4e 20 32 | 30 0a 23 64 65 66 69 6e |ASSLEN 2|0.#defin|
|00003490| 65 20 50 41 54 48 4c 45 | 4e 20 32 35 36 0a 23 64 |e PATHLE|N 256.#d|
|000034a0| 65 66 69 6e 65 20 42 55 | 46 4c 45 4e 20 31 30 32 |efine BU|FLEN 102|
|000034b0| 34 0a 0a 23 69 66 6e 64 | 65 66 20 56 45 52 53 49 |4..#ifnd|ef VERSI|
|000034c0| 4f 4e 0a 23 64 65 66 69 | 6e 65 20 56 45 52 53 49 |ON.#defi|ne VERSI|
|000034d0| 4f 4e 20 22 76 3f 2e 3f | 3f 22 0a 23 65 6e 64 69 |ON "v?.?|?".#endi|
|000034e0| 66 0a 0a 74 79 70 65 64 | 65 66 20 73 74 72 75 63 |f..typed|ef struc|
|000034f0| 74 20 7b 0a 20 20 20 20 | 20 20 20 20 69 6e 74 20 |t {. | int |
|00003500| 68 65 61 64 3b 0a 20 20 | 20 20 20 20 20 20 69 6e |head;. | in|
|00003510| 74 20 74 61 69 6c 3b 0a | 20 20 20 20 20 20 20 20 |t tail;.| |
|00003520| 63 68 61 72 20 62 75 66 | 66 65 72 5b 42 55 46 4c |char buf|fer[BUFL|
|00003530| 45 4e 5d 3b 0a 7d 20 66 | 69 66 6f 62 75 66 66 65 |EN];.} f|ifobuffe|
|00003540| 72 3b 0a 0a 73 74 72 75 | 63 74 20 76 68 6f 73 74 |r;..stru|ct vhost|
|00003550| 0a 7b 0a 20 20 20 73 74 | 72 75 63 74 20 76 68 6f |.{. st|ruct vho|
|00003560| 73 74 20 2a 6e 65 78 74 | 3b 0a 20 20 20 63 68 61 |st *next|;. cha|
|00003570| 72 20 68 6f 73 74 5b 48 | 4f 53 54 4c 45 4e 5d 3b |r host[H|OSTLEN];|
|00003580| 0a 7d 3b 0a 0a 74 79 70 | 65 64 65 66 20 73 74 72 |.};..typ|edef str|
|00003590| 75 63 74 0a 7b 0a 20 20 | 20 75 6e 73 69 67 6e 65 |uct.{. | unsigne|
|000035a0| 64 20 69 6e 74 20 63 75 | 3b 0a 20 20 20 46 49 4c |d int cu|;. FIL|
|000035b0| 45 20 2a 6c 6f 67 66 3b | 0a 20 20 20 63 68 61 72 |E *logf;|. char|
|000035c0| 20 63 66 67 66 69 6c 65 | 5b 50 41 54 48 4c 45 4e | cfgfile|[PATHLEN|
|000035d0| 5d 3b 0a 20 20 20 63 68 | 61 72 20 70 69 64 66 69 |];. ch|ar pidfi|
|000035e0| 6c 65 5b 50 41 54 48 4c | 45 4e 5d 3b 0a 20 20 20 |le[PATHL|EN];. |
|000035f0| 63 68 61 72 20 6c 6f 67 | 66 69 6c 65 5b 50 41 54 |char log|file[PAT|
|00003600| 48 4c 45 4e 5d 3b 0a 20 | 20 20 63 68 61 72 20 66 |HLEN];. | char f|
|00003610| 61 6b 65 69 64 5b 50 41 | 54 48 4c 45 4e 5d 3b 0a |akeid[PA|THLEN];.|
|00003620| 20 20 20 63 68 61 72 20 | 63 6c 6f 61 6b 5b 50 41 | char |cloak[PA|
|00003630| 54 48 4c 45 4e 5d 3b 0a | 20 20 20 63 68 61 72 20 |THLEN];.| char |
|00003640| 2a 68 6f 6d 65 64 69 72 | 3b 0a 0a 20 20 20 75 6e |*homedir|;.. un|
|00003650| 73 69 67 6e 65 64 20 69 | 6e 74 20 6c 70 6f 72 74 |signed i|nt lport|
|00003660| 3b 0a 20 20 20 75 6e 73 | 69 67 6e 65 64 20 69 6e |;. uns|igned in|
|00003670| 74 20 64 70 6f 72 74 3b | 0a 20 20 20 75 6e 73 69 |t dport;|. unsi|
|00003680| 67 6e 65 64 20 69 6e 74 | 20 6d 61 78 75 73 65 72 |gned int| maxuser|
|00003690| 73 3b 0a 20 20 20 63 68 | 61 72 20 70 61 73 73 5b |s;. ch|ar pass[|
|000036a0| 50 41 53 53 4c 45 4e 5d | 3b 0a 20 20 20 63 68 61 |PASSLEN]|;. cha|
|000036b0| 72 20 6f 70 65 72 5b 50 | 41 53 53 4c 45 4e 5d 3b |r oper[P|ASSLEN];|
|000036c0| 0a 20 20 20 73 74 72 75 | 63 74 20 76 68 6f 73 74 |. stru|ct vhost|
|000036d0| 20 76 68 6f 73 74 73 3b | 0a 20 20 20 63 68 61 72 | vhosts;|. char|
|000036e0| 20 6c 68 6f 73 74 5b 48 | 4f 53 54 4c 45 4e 5d 3b | lhost[H|OSTLEN];|
|000036f0| 0a 7d 20 74 63 6f 6e 66 | 3b 0a 00 00 00 00 00 00 |.} tconf|;.......|
|00003700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003800| 69 62 6e 63 32 2e 30 61 | 2f 4d 61 6b 65 66 69 6c |ibnc2.0a|/Makefil|
|00003810| 65 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |e.......|........|
|00003820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003860| 00 00 00 00 31 30 30 36 | 30 30 20 00 20 20 20 20 |....1006|00 . |
|00003870| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00003880| 20 20 20 31 36 37 30 20 | 20 36 35 32 34 33 36 31 | 1670 | 6524361|
|00003890| 32 30 37 20 20 31 32 31 | 34 31 00 20 30 00 00 00 |207 121|41. 0...|
|000038a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000038b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000038c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000038d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000038e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000038f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003900| 00 75 73 74 61 72 20 20 | 00 76 30 30 64 30 30 00 |.ustar |.v00d00.|
|00003910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003920| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00003930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003a00| 23 0a 23 20 20 54 68 69 | 73 20 69 73 20 74 68 65 |#.# Thi|s is the|
|00003a10| 20 4d 61 6b 65 66 69 6c | 65 20 66 6f 72 20 49 52 | Makefil|e for IR|
|00003a20| 43 20 42 6f 75 6e 63 65 | 20 28 61 6e 20 69 72 63 |C Bounce| (an irc|
|00003a30| 20 70 72 6f 78 79 29 0a | 23 0a 0a 56 45 52 53 49 | proxy).|#..VERSI|
|00003a40| 4f 4e 3d 76 32 2e 30 61 | 0a 0a 43 43 3d 67 63 63 |ON=v2.0a|..CC=gcc|
|00003a50| 0a 54 41 52 3d 74 61 72 | 0a 53 52 43 3d 62 6e 63 |.TAR=tar|.SRC=bnc|
|00003a60| 2e 63 20 68 65 6c 70 2e | 63 20 63 6f 6e 66 2e 63 |.c help.|c conf.c|
|00003a70| 20 6e 65 74 2e 63 20 66 | 69 66 6f 2e 63 20 73 65 | net.c f|ifo.c se|
|00003a80| 72 76 2e 63 0a 4f 42 4a | 53 3d 24 28 53 52 43 3a |rv.c.OBJ|S=$(SRC:|
|00003a90| 25 2e 63 3d 25 2e 6f 29 | 0a 49 4e 53 54 41 4c 4c |%.c=%.o)|.INSTALL|
|00003aa0| 5f 44 49 52 3d 2f 75 73 | 72 2f 6c 6f 63 61 6c 2f |_DIR=/us|r/local/|
|00003ab0| 62 69 6e 0a 43 46 4c 41 | 47 53 3d 2d 44 56 45 52 |bin.CFLA|GS=-DVER|
|00003ac0| 53 49 4f 4e 3d 27 22 24 | 7b 56 45 52 53 49 4f 4e |SION='"$|{VERSION|
|00003ad0| 7d 22 27 20 2d 4f 36 20 | 2d 67 33 0a 0a 61 6c 6c |}"' -O6 |-g3..all|
|00003ae0| 3a 09 62 75 69 6c 64 0a | 0a 62 6e 63 2e 6f 3a 20 |:.build.|.bnc.o: |
|00003af0| 63 6f 6d 6d 6f 6e 2e 68 | 20 62 6e 63 2e 63 20 4d |common.h| bnc.c M|
|00003b00| 61 6b 65 66 69 6c 65 0a | 09 24 7b 43 43 7d 20 24 |akefile.|.${CC} $|
|00003b10| 7b 43 46 4c 41 47 53 7d | 20 2d 63 20 62 6e 63 2e |{CFLAGS}| -c bnc.|
|00003b20| 63 0a 68 65 6c 70 2e 6f | 3a 20 63 6f 6d 6d 6f 6e |c.help.o|: common|
|00003b30| 2e 68 20 68 65 6c 70 2e | 63 20 4d 61 6b 65 66 69 |.h help.|c Makefi|
|00003b40| 6c 65 0a 09 24 7b 43 43 | 7d 20 24 7b 43 46 4c 41 |le..${CC|} ${CFLA|
|00003b50| 47 53 7d 20 2d 63 20 68 | 65 6c 70 2e 63 0a 63 6f |GS} -c h|elp.c.co|
|00003b60| 6e 66 2e 6f 3a 20 63 6f | 6d 6d 6f 6e 2e 68 20 63 |nf.o: co|mmon.h c|
|00003b70| 6f 6e 66 2e 63 20 4d 61 | 6b 65 66 69 6c 65 0a 09 |onf.c Ma|kefile..|
|00003b80| 24 7b 43 43 7d 20 24 7b | 43 46 4c 41 47 53 7d 20 |${CC} ${|CFLAGS} |
|00003b90| 2d 63 20 63 6f 6e 66 2e | 63 0a 6e 65 74 2e 6f 3a |-c conf.|c.net.o:|
|00003ba0| 20 63 6f 6d 6d 6f 6e 2e | 68 20 6e 65 74 2e 63 20 | common.|h net.c |
|00003bb0| 4d 61 6b 65 66 69 6c 65 | 0a 09 24 7b 43 43 7d 20 |Makefile|..${CC} |
|00003bc0| 24 7b 43 46 4c 41 47 53 | 7d 20 2d 63 20 6e 65 74 |${CFLAGS|} -c net|
|00003bd0| 2e 63 0a 66 69 66 6f 2e | 6f 3a 20 63 6f 6d 6d 6f |.c.fifo.|o: commo|
|00003be0| 6e 2e 68 20 66 69 66 6f | 2e 63 20 4d 61 6b 65 66 |n.h fifo|.c Makef|
|00003bf0| 69 6c 65 0a 09 24 7b 43 | 43 7d 20 24 7b 43 46 4c |ile..${C|C} ${CFL|
|00003c00| 41 47 53 7d 20 2d 63 20 | 66 69 66 6f 2e 63 0a 73 |AGS} -c |fifo.c.s|
|00003c10| 65 72 76 2e 6f 3a 20 63 | 6f 6d 6d 6f 6e 2e 68 20 |erv.o: c|ommon.h |
|00003c20| 73 65 72 76 2e 63 20 4d | 61 6b 65 66 69 6c 65 0a |serv.c M|akefile.|
|00003c30| 09 24 7b 43 43 7d 20 24 | 7b 43 46 4c 41 47 53 7d |.${CC} $|{CFLAGS}|
|00003c40| 20 2d 63 20 73 65 72 76 | 2e 63 0a 0a 62 75 69 6c | -c serv|.c..buil|
|00003c50| 64 3a 20 24 7b 4f 42 4a | 53 7d 20 4d 61 6b 65 66 |d: ${OBJ|S} Makef|
|00003c60| 69 6c 65 0a 09 24 7b 43 | 43 7d 20 2d 4f 33 20 2d |ile..${C|C} -O3 -|
|00003c70| 6f 20 62 6e 63 20 24 7b | 4f 42 4a 53 7d 0a 09 40 |o bnc ${|OBJS}..@|
|00003c80| 73 74 72 69 70 20 62 6e | 63 0a 09 40 62 6e 63 20 |strip bn|c..@bnc |
|00003c90| 2d 69 0a 0a 63 6c 65 61 | 6e 3a 0a 09 40 62 6e 63 |-i..clea|n:..@bnc|
|00003ca0| 20 2d 66 0a 09 40 72 6d | 20 2d 72 66 20 63 6f 72 | -f..@rm| -rf cor|
|00003cb0| 65 20 62 6e 63 20 62 6e | 63 2e 6c 6f 67 20 62 6e |e bnc bn|c.log bn|
|00003cc0| 63 2e 70 69 64 20 2a 2e | 6f 20 2a 7e 0a 0a 64 69 |c.pid *.|o *~..di|
|00003cd0| 73 74 3a 20 20 20 63 6c | 65 61 6e 0a 09 40 72 6d |st: cl|ean..@rm|
|00003ce0| 20 2d 66 20 62 6e 63 2e | 63 6f 6e 66 0a 09 40 28 | -f bnc.|conf..@(|
|00003cf0| 50 41 43 4b 4e 41 4d 45 | 3d 60 62 61 73 65 6e 61 |PACKNAME|=`basena|
|00003d00| 6d 65 20 5c 60 70 77 64 | 5c 60 60 20 3b 20 63 64 |me \`pwd|\`` ; cd|
|00003d10| 20 2e 2e 20 3b 20 74 6f | 75 63 68 20 2d 2d 66 69 | .. ; to|uch --fi|
|00003d20| 6c 65 20 24 24 50 41 43 | 4b 4e 41 4d 45 2f 62 6e |le $$PAC|KNAME/bn|
|00003d30| 63 2e 63 20 24 24 50 41 | 43 4b 4e 41 4d 45 20 24 |c.c $$PA|CKNAME $|
|00003d40| 24 50 41 43 4b 4e 41 4d | 45 2f 2a 20 3b 20 24 28 |$PACKNAM|E/* ; $(|
|00003d50| 54 41 52 29 20 63 66 20 | 2d 20 24 24 50 41 43 4b |TAR) cf |- $$PACK|
|00003d60| 4e 41 4d 45 20 7c 20 67 | 7a 69 70 20 2d 39 20 3e |NAME | g|zip -9 >|
|00003d70| 24 24 50 41 43 4b 4e 41 | 4d 45 2e 74 61 72 2e 67 |$$PACKNA|ME.tar.g|
|00003d80| 7a 29 0a 0a 69 6e 73 74 | 61 6c 6c 3a 20 61 6c 6c |z)..inst|all: all|
|00003d90| 0a 09 40 69 6e 73 74 61 | 6c 6c 20 2d 73 20 2d 6d |..@insta|ll -s -m|
|00003da0| 20 37 35 35 20 62 6e 63 | 20 24 28 49 4e 53 54 41 | 755 bnc| $(INSTA|
|00003db0| 4c 4c 5f 44 49 52 29 0a | 00 00 00 00 00 00 00 00 |LL_DIR).|........|
|00003dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e00| 69 62 6e 63 32 2e 30 61 | 2f 73 65 72 76 2e 63 00 |ibnc2.0a|/serv.c.|
|00003e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e60| 00 00 00 00 31 30 30 36 | 30 30 20 00 20 20 20 20 |....1006|00 . |
|00003e70| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00003e80| 20 20 33 37 36 32 31 20 | 20 36 35 32 34 33 36 31 | 37621 | 6524361|
|00003e90| 32 30 37 20 20 31 31 36 | 35 31 00 20 30 00 00 00 |207 116|51. 0...|
|00003ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f00| 00 75 73 74 61 72 20 20 | 00 76 30 30 64 30 30 00 |.ustar |.v00d00.|
|00003f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f20| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00003f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004000| 2f 2a 0a 20 20 20 54 68 | 69 73 20 66 69 6c 65 20 |/*. Th|is file |
|00004010| 69 73 20 70 61 72 74 20 | 6f 66 20 74 68 65 20 49 |is part |of the I|
|00004020| 52 43 20 42 6f 75 6e 63 | 65 20 73 6f 75 72 63 65 |RC Bounc|e source|
|00004030| 20 63 6f 64 65 0a 20 20 | 20 63 6f 70 79 72 69 67 | code. | copyrig|
|00004040| 68 74 20 28 63 29 20 31 | 39 39 38 20 76 30 30 64 |ht (c) 1|998 v00d|
|00004050| 30 30 20 4e 65 74 20 53 | 65 72 76 69 63 65 73 0a |00 Net S|ervices.|
|00004060| 20 20 20 61 6e 64 20 69 | 73 20 64 69 73 74 72 69 | and i|s distri|
|00004070| 62 75 74 65 64 20 61 63 | 63 6f 72 64 69 6e 67 20 |buted ac|cording |
|00004080| 74 6f 20 74 68 65 20 47 | 4e 55 20 67 65 6e 65 72 |to the G|NU gener|
|00004090| 61 6c 20 70 75 62 6c 69 | 63 20 6c 69 63 65 6e 73 |al publi|c licens|
|000040a0| 65 2e 0a 0a 20 20 20 54 | 68 69 73 20 70 72 6f 67 |e... T|his prog|
|000040b0| 72 61 6d 20 69 73 20 66 | 72 65 65 20 73 6f 66 74 |ram is f|ree soft|
|000040c0| 77 61 72 65 3b 20 79 6f | 75 20 63 61 6e 20 72 65 |ware; yo|u can re|
|000040d0| 64 69 73 74 72 69 62 75 | 74 65 20 69 74 20 61 6e |distribu|te it an|
|000040e0| 64 2f 6f 72 20 6d 6f 64 | 69 66 79 0a 20 20 20 69 |d/or mod|ify. i|
|000040f0| 74 20 75 6e 64 65 72 20 | 74 68 65 20 74 65 72 6d |t under |the term|
|00004100| 73 20 6f 66 20 74 68 65 | 20 47 4e 55 20 47 65 6e |s of the| GNU Gen|
|00004110| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|00004120| 6e 73 65 20 61 73 20 70 | 75 62 6c 69 73 68 65 64 |nse as p|ublished|
|00004130| 20 62 79 0a 20 20 20 74 | 68 65 20 46 72 65 65 20 | by. t|he Free |
|00004140| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|00004150| 69 6f 6e 3b 20 65 69 74 | 68 65 72 20 76 65 72 73 |ion; eit|her vers|
|00004160| 69 6f 6e 20 32 20 6f 66 | 20 74 68 65 20 4c 69 63 |ion 2 of| the Lic|
|00004170| 65 6e 73 65 2c 20 6f 72 | 0a 20 20 20 28 61 74 20 |ense, or|. (at |
|00004180| 79 6f 75 72 20 6f 70 74 | 69 6f 6e 29 20 61 6e 79 |your opt|ion) any|
|00004190| 20 6c 61 74 65 72 20 76 | 65 72 73 69 6f 6e 2e 0a | later v|ersion..|
|000041a0| 0a 20 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d |. This| program|
|000041b0| 20 69 73 20 64 69 73 74 | 72 69 62 75 74 65 64 20 | is dist|ributed |
|000041c0| 69 6e 20 74 68 65 20 68 | 6f 70 65 20 74 68 61 74 |in the h|ope that|
|000041d0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 75 73 65 66 | it will| be usef|
|000041e0| 75 6c 2c 0a 20 20 20 62 | 75 74 20 57 49 54 48 4f |ul,. b|ut WITHO|
|000041f0| 55 54 20 41 4e 59 20 57 | 41 52 52 41 4e 54 59 3b |UT ANY W|ARRANTY;|
|00004200| 20 77 69 74 68 6f 75 74 | 20 65 76 65 6e 20 74 68 | without| even th|
|00004210| 65 20 69 6d 70 6c 69 65 | 64 20 77 61 72 72 61 6e |e implie|d warran|
|00004220| 74 79 20 6f 66 0a 20 20 | 20 4d 45 52 43 48 41 4e |ty of. | MERCHAN|
|00004230| 54 41 42 49 4c 49 54 59 | 20 6f 72 20 46 49 54 4e |TABILITY| or FITN|
|00004240| 45 53 53 20 46 4f 52 20 | 41 20 50 41 52 54 49 43 |ESS FOR |A PARTIC|
|00004250| 55 4c 41 52 20 50 55 52 | 50 4f 53 45 2e 20 20 53 |ULAR PUR|POSE. S|
|00004260| 65 65 20 74 68 65 0a 20 | 20 20 47 4e 55 20 47 65 |ee the. | GNU Ge|
|00004270| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 20 4c 69 63 |neral Pu|blic Lic|
|00004280| 65 6e 73 65 20 66 6f 72 | 20 6d 6f 72 65 20 64 65 |ense for| more de|
|00004290| 74 61 69 6c 73 2e 0a 0a | 20 20 20 59 6f 75 20 73 |tails...| You s|
|000042a0| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|000042b0| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|000042c0| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|000042d0| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 0a 20 20 20 |blic Lic|ense. |
|000042e0| 61 6c 6f 6e 67 20 77 69 | 74 68 20 74 68 69 73 20 |along wi|th this |
|000042f0| 70 72 6f 67 72 61 6d 3b | 20 69 66 20 6e 6f 74 2c |program;| if not,|
|00004300| 20 77 72 69 74 65 20 74 | 6f 20 74 68 65 20 46 72 | write t|o the Fr|
|00004310| 65 65 20 53 6f 66 74 77 | 61 72 65 0a 20 20 20 46 |ee Softw|are. F|
|00004320| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 2c |oundatio|n, Inc.,|
|00004330| 20 36 37 35 20 4d 61 73 | 73 20 41 76 65 2c 20 43 | 675 Mas|s Ave, C|
|00004340| 61 6d 62 72 69 64 67 65 | 2c 20 4d 41 20 30 32 31 |ambridge|, MA 021|
|00004350| 33 39 2c 20 55 53 41 2e | 0a 0a 20 20 20 54 68 65 |39, USA.|.. The|
|00004360| 20 61 75 74 68 6f 72 20 | 28 52 6f 62 65 72 74 20 | author |(Robert |
|00004370| 43 6c 61 72 6b 29 20 63 | 61 6e 20 62 65 20 72 65 |Clark) c|an be re|
|00004380| 61 63 68 65 64 20 61 74 | 3a 20 76 30 30 64 30 30 |ached at|: v00d00|
|00004390| 40 68 65 6d 70 73 65 65 | 64 2e 63 6f 6d 0a 0a 20 |@hempsee|d.com.. |
|000043a0| 20 20 54 68 69 73 20 63 | 6f 64 65 20 69 73 20 62 | This c|ode is b|
|000043b0| 61 73 65 64 20 6f 6e 20 | 49 72 63 20 50 72 6f 78 |ased on |Irc Prox|
|000043c0| 79 20 28 63 29 31 39 39 | 37 2d 39 38 20 4a 61 6d |y (c)199|7-98 Jam|
|000043d0| 65 73 20 53 65 74 65 72 | 0a 2a 2f 0a 0a 23 69 6e |es Seter|.*/..#in|
|000043e0| 63 6c 75 64 65 20 22 63 | 6f 6d 6d 6f 6e 2e 68 22 |clude "c|ommon.h"|
|000043f0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 6c 69 |.#includ|e <stdli|
|00004400| 62 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 75 |b.h>.#in|clude <u|
|00004410| 6e 69 73 74 64 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |nistd.h>|.#includ|
|00004420| 65 20 3c 73 74 72 69 6e | 67 2e 68 3e 0a 23 69 6e |e <strin|g.h>.#in|
|00004430| 63 6c 75 64 65 20 3c 73 | 69 67 6e 61 6c 2e 68 3e |clude <s|ignal.h>|
|00004440| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 74 |.#includ|e <sys/t|
|00004450| 79 70 65 73 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |ypes.h>.|#include|
|00004460| 20 3c 73 79 73 2f 73 6f | 63 6b 65 74 2e 68 3e 0a | <sys/so|cket.h>.|
|00004470| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 74 69 |#include| <sys/ti|
|00004480| 6d 65 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |me.h>.#i|nclude <|
|00004490| 73 79 73 2f 77 61 69 74 | 2e 68 3e 0a 23 69 6e 63 |sys/wait|.h>.#inc|
|000044a0| 6c 75 64 65 20 3c 6e 65 | 74 69 6e 65 74 2f 69 6e |lude <ne|tinet/in|
|000044b0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 61 72 |.h>.#inc|lude <ar|
|000044c0| 70 61 2f 69 6e 65 74 2e | 68 3e 0a 23 69 6e 63 6c |pa/inet.|h>.#incl|
|000044d0| 75 64 65 20 3c 65 72 72 | 6e 6f 2e 68 3e 0a 23 69 |ude <err|no.h>.#i|
|000044e0| 6e 63 6c 75 64 65 20 3c | 6e 65 74 64 62 2e 68 3e |nclude <|netdb.h>|
|000044f0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 70 77 64 2e 68 |.#includ|e <pwd.h|
|00004500| 3e 0a 0a 65 78 74 65 72 | 6e 20 76 6f 69 64 20 70 |>..exter|n void p|
|00004510| 75 74 6c 6f 67 28 63 68 | 61 72 20 2a 66 6f 72 6d |utlog(ch|ar *form|
|00004520| 61 74 2c 20 2e 2e 2e 29 | 3b 0a 65 78 74 65 72 6e |at, ...)|;.extern|
|00004530| 20 63 68 61 72 20 2a 67 | 65 74 68 6f 73 74 28 73 | char *g|ethost(s|
|00004540| 74 72 75 63 74 20 69 6e | 5f 61 64 64 72 20 2a 61 |truct in|_addr *a|
|00004550| 64 64 72 29 3b 0a 65 78 | 74 65 72 6e 20 69 6e 74 |ddr);.ex|tern int|
|00004560| 20 6e 70 72 69 6e 74 66 | 28 69 6e 74 20 73 2c 20 | nprintf|(int s, |
|00004570| 63 68 61 72 20 2a 66 6f | 72 6d 61 74 2c 20 2e 2e |char *fo|rmat, ..|
|00004580| 2e 29 3b 0a 65 78 74 65 | 72 6e 20 69 6e 74 20 64 |.);.exte|rn int d|
|00004590| 6f 5f 63 6f 6e 6e 65 63 | 74 28 63 68 61 72 20 2a |o_connec|t(char *|
|000045a0| 76 68 6f 73 74 6e 61 6d | 65 2c 20 63 68 61 72 20 |vhostnam|e, char |
|000045b0| 2a 68 6f 73 74 6e 61 6d | 65 2c 20 75 5f 73 68 6f |*hostnam|e, u_sho|
|000045c0| 72 74 20 70 6f 72 74 29 | 3b 0a 0a 69 6e 74 20 73 |rt port)|;..int s|
|000045d0| 69 6e 6c 65 6e 2c 61 6c | 6c 62 75 66 6c 65 6e 2c |inlen,al|lbuflen,|
|000045e0| 68 69 67 68 66 64 2c 73 | 5f 73 6f 63 6b 3d 30 3b |highfd,s|_sock=0;|
|000045f0| 0a 75 6e 73 69 67 6e 65 | 64 20 63 68 61 72 20 61 |.unsigne|d char a|
|00004600| 6c 6c 62 75 66 5b 42 55 | 46 4c 45 4e 5d 2c 6c 69 |llbuf[BU|FLEN],li|
|00004610| 6e 62 75 66 66 5b 42 55 | 46 4c 45 4e 5d 3b 0a 73 |nbuff[BU|FLEN];.s|
|00004620| 74 72 75 63 74 20 73 6f | 63 6b 61 64 64 72 5f 69 |truct so|ckaddr_i|
|00004630| 6e 20 6d 79 73 69 6e 3b | 0a 74 63 6f 6e 66 20 2a |n mysin;|.tconf *|
|00004640| 63 6f 6e 66 3b 0a 0a 73 | 74 72 75 63 74 20 75 63 |conf;..s|truct uc|
|00004650| 6f 6e 65 6e 74 72 79 0a | 7b 0a 20 20 20 73 74 72 |onentry.|{. str|
|00004660| 75 63 74 20 75 63 6f 6e | 65 6e 74 72 79 20 2a 6e |uct ucon|entry *n|
|00004670| 65 78 74 3b 0a 20 20 20 | 63 68 61 72 20 75 73 65 |ext;. |char use|
|00004680| 72 5b 32 35 36 5d 3b 0a | 20 20 20 63 68 61 72 20 |r[256];.| char |
|00004690| 6e 69 63 6b 5b 33 30 5d | 3b 0a 20 20 20 63 68 61 |nick[30]|;. cha|
|000046a0| 72 20 76 68 6f 73 74 5b | 48 4f 53 54 4c 45 4e 5d |r vhost[|HOSTLEN]|
|000046b0| 3b 0a 20 20 20 63 68 61 | 72 20 66 72 6f 6d 69 70 |;. cha|r fromip|
|000046c0| 5b 48 4f 53 54 4c 45 4e | 5d 3b 0a 20 20 20 75 6e |[HOSTLEN|];. un|
|000046d0| 73 69 67 6e 65 64 20 69 | 6e 74 0a 20 20 20 20 20 |signed i|nt. |
|000046e0| 20 75 3a 31 2c 0a 20 20 | 20 20 20 20 70 3a 31 2c | u:1,. | p:1,|
|000046f0| 0a 20 20 20 20 20 20 6e | 3a 31 2c 0a 20 20 20 20 |. n|:1,. |
|00004700| 20 20 73 3a 31 2c 0a 20 | 20 20 20 20 20 62 3a 31 | s:1,. | b:1|
|00004710| 3b 0a 20 20 20 69 6e 74 | 20 66 64 3b 0a 20 20 20 |;. int| fd;. |
|00004720| 63 68 61 72 20 69 64 65 | 6e 74 5b 39 5d 3b 0a 20 |char ide|nt[9];. |
|00004730| 20 20 66 69 66 6f 62 75 | 66 66 65 72 20 62 69 66 | fifobu|ffer bif|
|00004740| 66 3b 0a 7d 3b 0a 0a 73 | 74 72 75 63 74 20 63 6f |f;.};..s|truct co|
|00004750| 6e 65 6e 74 72 79 0a 7b | 0a 20 20 20 20 73 74 72 |nentry.{|. str|
|00004760| 75 63 74 20 63 6f 6e 65 | 6e 74 72 79 20 2a 6e 65 |uct cone|ntry *ne|
|00004770| 78 74 3b 0a 20 20 20 20 | 63 68 61 72 20 6e 69 63 |xt;. |char nic|
|00004780| 6b 5b 33 30 5d 3b 0a 20 | 20 20 20 63 68 61 72 20 |k[30];. | char |
|00004790| 66 72 6f 6d 69 70 5b 48 | 4f 53 54 4c 45 4e 5d 3b |fromip[H|OSTLEN];|
|000047a0| 0a 20 20 20 20 69 6e 74 | 20 69 66 64 3b 0a 20 20 |. int| ifd;. |
|000047b0| 20 20 69 6e 74 20 6f 66 | 64 3b 0a 7d 3b 0a 0a 73 | int of|d;.};..s|
|000047c0| 74 72 75 63 74 20 75 63 | 6f 6e 65 6e 74 72 79 20 |truct uc|onentry |
|000047d0| 68 65 61 64 75 63 6f 6e | 3b 0a 73 74 72 75 63 74 |headucon|;.struct|
|000047e0| 20 63 6f 6e 65 6e 74 72 | 79 20 68 65 61 64 63 6f | conentr|y headco|
|000047f0| 6e 3b 0a 0a 73 74 72 75 | 63 74 20 75 63 6f 6e 65 |n;..stru|ct ucone|
|00004800| 6e 74 72 79 20 2a 0a 61 | 64 64 75 63 6f 6e 28 73 |ntry *.a|dducon(s|
|00004810| 74 72 75 63 74 20 75 63 | 6f 6e 65 6e 74 72 79 20 |truct uc|onentry |
|00004820| 2a 6c 69 73 74 5f 70 74 | 72 29 0a 7b 0a 20 20 20 |*list_pt|r).{. |
|00004830| 77 68 69 6c 65 20 28 6c | 69 73 74 5f 70 74 72 2d |while (l|ist_ptr-|
|00004840| 3e 6e 65 78 74 21 3d 4e | 55 4c 4c 29 20 6c 69 73 |>next!=N|ULL) lis|
|00004850| 74 5f 70 74 72 3d 6c 69 | 73 74 5f 70 74 72 2d 3e |t_ptr=li|st_ptr->|
|00004860| 6e 65 78 74 3b 0a 20 20 | 20 6c 69 73 74 5f 70 74 |next;. | list_pt|
|00004870| 72 2d 3e 6e 65 78 74 3d | 28 73 74 72 75 63 74 20 |r->next=|(struct |
|00004880| 75 63 6f 6e 65 6e 74 72 | 79 20 2a 29 20 6d 61 6c |uconentr|y *) mal|
|00004890| 6c 6f 63 20 28 73 69 7a | 65 6f 66 20 28 73 74 72 |loc (siz|eof (str|
|000048a0| 75 63 74 20 75 63 6f 6e | 65 6e 74 72 79 29 29 3b |uct ucon|entry));|
|000048b0| 0a 20 20 20 69 66 20 28 | 6c 69 73 74 5f 70 74 72 |. if (|list_ptr|
|000048c0| 2d 3e 6e 65 78 74 21 3d | 4e 55 4c 4c 29 20 7b 0a |->next!=|NULL) {.|
|000048d0| 20 20 20 20 20 20 6d 65 | 6d 73 65 74 28 6c 69 73 | me|mset(lis|
|000048e0| 74 5f 70 74 72 2d 3e 6e | 65 78 74 2c 30 2c 73 69 |t_ptr->n|ext,0,si|
|000048f0| 7a 65 6f 66 28 73 74 72 | 75 63 74 20 75 63 6f 6e |zeof(str|uct ucon|
|00004900| 65 6e 74 72 79 29 29 3b | 0a 20 20 20 20 20 20 28 |entry));|. (|
|00004910| 6c 69 73 74 5f 70 74 72 | 2d 3e 6e 65 78 74 29 2d |list_ptr|->next)-|
|00004920| 3e 6e 65 78 74 3d 28 73 | 74 72 75 63 74 20 75 63 |>next=(s|truct uc|
|00004930| 6f 6e 65 6e 74 72 79 20 | 2a 29 20 4e 55 4c 4c 3b |onentry |*) NULL;|
|00004940| 0a 20 20 20 7d 0a 20 20 | 20 72 65 74 75 72 6e 20 |. }. | return |
|00004950| 28 6c 69 73 74 5f 70 74 | 72 2d 3e 6e 65 78 74 29 |(list_pt|r->next)|
|00004960| 3b 0a 7d 0a 0a 73 74 72 | 75 63 74 20 63 6f 6e 65 |;.}..str|uct cone|
|00004970| 6e 74 72 79 20 2a 0a 61 | 64 64 63 6f 6e 28 73 74 |ntry *.a|ddcon(st|
|00004980| 72 75 63 74 20 63 6f 6e | 65 6e 74 72 79 20 2a 6c |ruct con|entry *l|
|00004990| 69 73 74 5f 70 74 72 29 | 0a 7b 0a 20 20 20 77 68 |ist_ptr)|.{. wh|
|000049a0| 69 6c 65 20 28 6c 69 73 | 74 5f 70 74 72 2d 3e 6e |ile (lis|t_ptr->n|
|000049b0| 65 78 74 21 3d 4e 55 4c | 4c 29 20 6c 69 73 74 5f |ext!=NUL|L) list_|
|000049c0| 70 74 72 3d 6c 69 73 74 | 5f 70 74 72 2d 3e 6e 65 |ptr=list|_ptr->ne|
|000049d0| 78 74 3b 0a 20 20 20 6c | 69 73 74 5f 70 74 72 2d |xt;. l|ist_ptr-|
|000049e0| 3e 6e 65 78 74 3d 28 73 | 74 72 75 63 74 20 63 6f |>next=(s|truct co|
|000049f0| 6e 65 6e 74 72 79 20 2a | 29 20 6d 61 6c 6c 6f 63 |nentry *|) malloc|
|00004a00| 20 28 73 69 7a 65 6f 66 | 20 28 73 74 72 75 63 74 | (sizeof| (struct|
|00004a10| 20 63 6f 6e 65 6e 74 72 | 79 29 29 3b 0a 20 20 20 | conentr|y));. |
|00004a20| 69 66 20 28 6c 69 73 74 | 5f 70 74 72 2d 3e 6e 65 |if (list|_ptr->ne|
|00004a30| 78 74 21 3d 4e 55 4c 4c | 29 20 7b 0a 20 20 20 20 |xt!=NULL|) {. |
|00004a40| 20 20 6d 65 6d 73 65 74 | 28 6c 69 73 74 5f 70 74 | memset|(list_pt|
|00004a50| 72 2d 3e 6e 65 78 74 2c | 30 2c 73 69 7a 65 6f 66 |r->next,|0,sizeof|
|00004a60| 28 73 74 72 75 63 74 20 | 63 6f 6e 65 6e 74 72 79 |(struct |conentry|
|00004a70| 29 29 3b 0a 20 20 20 20 | 20 20 28 6c 69 73 74 5f |));. | (list_|
|00004a80| 70 74 72 2d 3e 6e 65 78 | 74 29 2d 3e 6e 65 78 74 |ptr->nex|t)->next|
|00004a90| 3d 28 73 74 72 75 63 74 | 20 63 6f 6e 65 6e 74 72 |=(struct| conentr|
|00004aa0| 79 20 2a 29 20 4e 55 4c | 4c 3b 0a 20 20 20 7d 0a |y *) NUL|L;. }.|
|00004ab0| 20 20 20 72 65 74 75 72 | 6e 20 28 6c 69 73 74 5f | retur|n (list_|
|00004ac0| 70 74 72 2d 3e 6e 65 78 | 74 29 3b 0a 7d 0a 0a 0a |ptr->nex|t);.}...|
|00004ad0| 73 74 72 75 63 74 20 75 | 63 6f 6e 65 6e 74 72 79 |struct u|conentry|
|00004ae0| 20 2a 0a 64 65 6c 75 63 | 6f 6e 28 73 74 72 75 63 | *.deluc|on(struc|
|00004af0| 74 20 75 63 6f 6e 65 6e | 74 72 79 20 2a 6c 69 73 |t uconen|try *lis|
|00004b00| 74 5f 70 74 72 2c 69 6e | 74 20 6e 66 64 29 0a 7b |t_ptr,in|t nfd).{|
|00004b10| 0a 20 20 20 73 74 72 75 | 63 74 20 75 63 6f 6e 65 |. stru|ct ucone|
|00004b20| 6e 74 72 79 20 2a 6c 61 | 73 74 5f 70 74 72 3b 0a |ntry *la|st_ptr;.|
|00004b30| 20 20 20 6c 61 73 74 5f | 70 74 72 3d 6c 69 73 74 | last_|ptr=list|
|00004b40| 5f 70 74 72 3b 0a 20 20 | 20 77 68 69 6c 65 20 28 |_ptr;. | while (|
|00004b50| 28 6c 69 73 74 5f 70 74 | 72 2d 3e 66 64 21 3d 6e |(list_pt|r->fd!=n|
|00004b60| 66 64 29 29 20 7b 0a 20 | 20 20 20 20 20 6c 61 73 |fd)) {. | las|
|00004b70| 74 5f 70 74 72 3d 6c 69 | 73 74 5f 70 74 72 3b 0a |t_ptr=li|st_ptr;.|
|00004b80| 20 20 20 20 20 20 69 66 | 20 28 28 6c 69 73 74 5f | if| ((list_|
|00004b90| 70 74 72 3d 6c 69 73 74 | 5f 70 74 72 2d 3e 6e 65 |ptr=list|_ptr->ne|
|00004ba0| 78 74 29 3d 3d 4e 55 4c | 4c 29 20 62 72 65 61 6b |xt)==NUL|L) break|
|00004bb0| 3b 0a 20 20 20 7d 0a 20 | 20 20 69 66 20 28 6c 69 |;. }. | if (li|
|00004bc0| 73 74 5f 70 74 72 21 3d | 4e 55 4c 4c 29 20 7b 0a |st_ptr!=|NULL) {.|
|00004bd0| 20 20 20 20 20 20 6c 61 | 73 74 5f 70 74 72 2d 3e | la|st_ptr->|
|00004be0| 6e 65 78 74 3d 6c 69 73 | 74 5f 70 74 72 2d 3e 6e |next=lis|t_ptr->n|
|00004bf0| 65 78 74 3b 0a 20 20 20 | 20 20 20 66 72 65 65 28 |ext;. | free(|
|00004c00| 6c 69 73 74 5f 70 74 72 | 29 3b 0a 20 20 20 7d 0a |list_ptr|);. }.|
|00004c10| 20 20 20 72 65 74 75 72 | 6e 20 6c 69 73 74 5f 70 | retur|n list_p|
|00004c20| 74 72 3b 0a 7d 0a 0a 73 | 74 72 75 63 74 20 63 6f |tr;.}..s|truct co|
|00004c30| 6e 65 6e 74 72 79 20 2a | 0a 64 65 6c 63 6f 6e 28 |nentry *|.delcon(|
|00004c40| 73 74 72 75 63 74 20 63 | 6f 6e 65 6e 74 72 79 20 |struct c|onentry |
|00004c50| 2a 6c 69 73 74 5f 70 74 | 72 2c 69 6e 74 20 6e 66 |*list_pt|r,int nf|
|00004c60| 64 29 0a 7b 0a 20 20 20 | 73 74 72 75 63 74 20 63 |d).{. |struct c|
|00004c70| 6f 6e 65 6e 74 72 79 20 | 2a 6c 61 73 74 5f 70 74 |onentry |*last_pt|
|00004c80| 72 3b 0a 20 20 20 0a 20 | 20 20 6c 61 73 74 5f 70 |r;. . | last_p|
|00004c90| 74 72 3d 6c 69 73 74 5f | 70 74 72 3b 0a 20 20 20 |tr=list_|ptr;. |
|00004ca0| 77 68 69 6c 65 20 28 28 | 6c 69 73 74 5f 70 74 72 |while ((|list_ptr|
|00004cb0| 2d 3e 69 66 64 21 3d 6e | 66 64 29 29 20 7b 0a 20 |->ifd!=n|fd)) {. |
|00004cc0| 20 20 20 20 20 20 69 66 | 20 28 28 6c 69 73 74 5f | if| ((list_|
|00004cd0| 70 74 72 2d 3e 6f 66 64 | 3d 3d 6e 66 64 29 29 20 |ptr->ofd|==nfd)) |
|00004ce0| 62 72 65 61 6b 3b 0a 20 | 20 20 20 20 20 20 6c 61 |break;. | la|
|00004cf0| 73 74 5f 70 74 72 3d 6c | 69 73 74 5f 70 74 72 3b |st_ptr=l|ist_ptr;|
|00004d00| 0a 20 20 20 20 20 20 20 | 69 66 20 28 28 6c 69 73 |. |if ((lis|
|00004d10| 74 5f 70 74 72 3d 6c 69 | 73 74 5f 70 74 72 2d 3e |t_ptr=li|st_ptr->|
|00004d20| 6e 65 78 74 29 3d 3d 4e | 55 4c 4c 29 20 62 72 65 |next)==N|ULL) bre|
|00004d30| 61 6b 3b 0a 20 20 20 0a | 20 20 20 7d 0a 20 20 20 |ak;. .| }. |
|00004d40| 69 66 28 6c 69 73 74 5f | 70 74 72 20 21 3d 20 4e |if(list_|ptr != N|
|00004d50| 55 4c 4c 29 20 7b 0a 20 | 20 20 20 20 20 6c 61 73 |ULL) {. | las|
|00004d60| 74 5f 70 74 72 2d 3e 6e | 65 78 74 3d 6c 69 73 74 |t_ptr->n|ext=list|
|00004d70| 5f 70 74 72 2d 3e 6e 65 | 78 74 3b 0a 20 20 20 20 |_ptr->ne|xt;. |
|00004d80| 20 20 66 72 65 65 28 6c | 69 73 74 5f 70 74 72 29 | free(l|ist_ptr)|
|00004d90| 3b 0a 20 20 20 7d 0a 20 | 20 20 72 65 74 75 72 6e |;. }. | return|
|00004da0| 20 6c 69 73 74 5f 70 74 | 72 3b 0a 7d 0a 0a 69 6e | list_pt|r;.}..in|
|00004db0| 74 0a 67 65 74 6f 74 68 | 65 72 28 73 74 72 75 63 |t.getoth|er(struc|
|00004dc0| 74 20 63 6f 6e 65 6e 74 | 72 79 20 2a 6c 69 73 74 |t conent|ry *list|
|00004dd0| 5f 70 74 72 2c 69 6e 74 | 20 6e 66 64 29 0a 7b 0a |_ptr,int| nfd).{.|
|00004de0| 20 20 20 77 68 69 6c 65 | 20 28 6c 69 73 74 5f 70 | while| (list_p|
|00004df0| 74 72 21 3d 4e 55 4c 4c | 29 20 7b 0a 20 20 20 20 |tr!=NULL|) {. |
|00004e00| 20 20 69 66 20 28 6c 69 | 73 74 5f 70 74 72 2d 3e | if (li|st_ptr->|
|00004e10| 6f 66 64 3d 3d 6e 66 64 | 29 20 72 65 74 75 72 6e |ofd==nfd|) return|
|00004e20| 20 6c 69 73 74 5f 70 74 | 72 2d 3e 69 66 64 3b 0a | list_pt|r->ifd;.|
|00004e30| 20 20 20 20 20 20 65 6c | 73 65 20 69 66 20 28 6c | el|se if (l|
|00004e40| 69 73 74 5f 70 74 72 2d | 3e 69 66 64 3d 3d 6e 66 |ist_ptr-|>ifd==nf|
|00004e50| 64 29 20 72 65 74 75 72 | 6e 20 6c 69 73 74 5f 70 |d) retur|n list_p|
|00004e60| 74 72 2d 3e 6f 66 64 3b | 0a 20 20 20 20 20 20 6c |tr->ofd;|. l|
|00004e70| 69 73 74 5f 70 74 72 3d | 6c 69 73 74 5f 70 74 72 |ist_ptr=|list_ptr|
|00004e80| 2d 3e 6e 65 78 74 3b 0a | 20 20 20 7d 0a 20 20 20 |->next;.| }. |
|00004e90| 72 65 74 75 72 6e 20 2d | 31 3b 0a 7d 0a 0a 73 74 |return -|1;.}..st|
|00004ea0| 72 75 63 74 20 63 6f 6e | 65 6e 74 72 79 20 2a 0a |ruct con|entry *.|
|00004eb0| 67 65 74 63 6f 6e 28 73 | 74 72 75 63 74 20 63 6f |getcon(s|truct co|
|00004ec0| 6e 65 6e 74 72 79 20 2a | 6c 69 73 74 5f 70 74 72 |nentry *|list_ptr|
|00004ed0| 2c 69 6e 74 20 6e 66 64 | 29 0a 7b 0a 20 20 20 77 |,int nfd|).{. w|
|00004ee0| 68 69 6c 65 20 28 6c 69 | 73 74 5f 70 74 72 21 3d |hile (li|st_ptr!=|
|00004ef0| 4e 55 4c 4c 29 20 7b 0a | 20 20 20 20 20 20 69 66 |NULL) {.| if|
|00004f00| 20 28 6c 69 73 74 5f 70 | 74 72 2d 3e 6f 66 64 3d | (list_p|tr->ofd=|
|00004f10| 3d 6e 66 64 29 20 72 65 | 74 75 72 6e 20 6c 69 73 |=nfd) re|turn lis|
|00004f20| 74 5f 70 74 72 3b 0a 20 | 20 20 20 20 20 65 6c 73 |t_ptr;. | els|
|00004f30| 65 20 69 66 20 28 6c 69 | 73 74 5f 70 74 72 2d 3e |e if (li|st_ptr->|
|00004f40| 69 66 64 3d 3d 6e 66 64 | 29 20 72 65 74 75 72 6e |ifd==nfd|) return|
|00004f50| 20 6c 69 73 74 5f 70 74 | 72 3b 0a 20 20 20 20 20 | list_pt|r;. |
|00004f60| 20 6c 69 73 74 5f 70 74 | 72 3d 6c 69 73 74 5f 70 | list_pt|r=list_p|
|00004f70| 74 72 2d 3e 6e 65 78 74 | 3b 0a 20 20 20 7d 0a 20 |tr->next|;. }. |
|00004f80| 20 20 72 65 74 75 72 6e | 20 4e 55 4c 4c 3b 0a 7d | return| NULL;.}|
|00004f90| 0a 0a 69 6e 74 0a 63 6f | 75 6e 74 66 64 73 28 73 |..int.co|untfds(s|
|00004fa0| 74 72 75 63 74 20 75 63 | 6f 6e 65 6e 74 72 79 20 |truct uc|onentry |
|00004fb0| 2a 75 63 6c 69 73 74 5f | 70 74 72 2c 20 73 74 72 |*uclist_|ptr, str|
|00004fc0| 75 63 74 20 63 6f 6e 65 | 6e 74 72 79 20 2a 63 6c |uct cone|ntry *cl|
|00004fd0| 69 73 74 5f 70 74 72 29 | 0a 7b 0a 20 20 20 69 6e |ist_ptr)|.{. in|
|00004fe0| 74 20 70 3d 30 3b 0a 20 | 20 20 77 68 69 6c 65 28 |t p=0;. | while(|
|00004ff0| 75 63 6c 69 73 74 5f 70 | 74 72 21 3d 4e 55 4c 4c |uclist_p|tr!=NULL|
|00005000| 29 20 7b 0a 20 20 20 20 | 20 20 75 63 6c 69 73 74 |) {. | uclist|
|00005010| 5f 70 74 72 3d 75 63 6c | 69 73 74 5f 70 74 72 2d |_ptr=ucl|ist_ptr-|
|00005020| 3e 6e 65 78 74 3b 0a 20 | 20 20 20 20 20 70 2b 2b |>next;. | p++|
|00005030| 3b 0a 20 20 20 7d 0a 20 | 20 20 77 68 69 6c 65 28 |;. }. | while(|
|00005040| 63 6c 69 73 74 5f 70 74 | 72 21 3d 4e 55 4c 4c 29 |clist_pt|r!=NULL)|
|00005050| 20 7b 0a 20 20 20 20 20 | 20 63 6c 69 73 74 5f 70 | {. | clist_p|
|00005060| 74 72 3d 63 6c 69 73 74 | 5f 70 74 72 2d 3e 6e 65 |tr=clist|_ptr->ne|
|00005070| 78 74 3b 0a 20 20 20 20 | 20 20 70 2b 2b 3b 0a 20 |xt;. | p++;. |
|00005080| 20 20 7d 0a 20 20 20 72 | 65 74 75 72 6e 20 70 3b | }. r|eturn p;|
|00005090| 0a 7d 0a 0a 69 6e 74 0a | 68 61 6e 64 6c 65 70 75 |.}..int.|handlepu|
|000050a0| 63 6f 6e 28 73 74 72 75 | 63 74 20 75 63 6f 6e 65 |con(stru|ct ucone|
|000050b0| 6e 74 72 79 20 2a 6c 69 | 73 74 5f 70 74 72 2c 20 |ntry *li|st_ptr, |
|000050c0| 69 6e 74 20 70 61 72 67 | 63 2c 20 63 68 61 72 20 |int parg|c, char |
|000050d0| 2a 2a 70 61 72 67 76 29 | 0a 7b 0a 20 20 20 69 6e |**pargv)|.{. in|
|000050e0| 74 20 70 2c 63 2c 66 2c | 73 3b 0a 20 20 20 73 74 |t p,c,f,|s;. st|
|000050f0| 72 75 63 74 20 63 6f 6e | 65 6e 74 72 79 20 2a 62 |ruct con|entry *b|
|00005100| 6f 62 3b 0a 20 20 20 73 | 74 72 75 63 74 20 68 6f |ob;. s|truct ho|
|00005110| 73 74 65 6e 74 20 2a 68 | 65 3b 0a 20 20 20 73 74 |stent *h|e;. st|
|00005120| 72 75 63 74 20 69 6e 5f | 61 64 64 72 20 61 64 64 |ruct in_|addr add|
|00005130| 72 3b 0a 20 20 20 63 68 | 61 72 20 2a 74 6d 70 3b |r;. ch|ar *tmp;|
|00005140| 0a 20 20 20 63 68 61 72 | 20 2a 70 61 73 62 3b 0a |. char| *pasb;.|
|00005150| 20 20 20 69 6e 74 20 63 | 73 2c 64 70 6f 72 74 3b | int c|s,dport;|
|00005160| 0a 20 20 20 46 49 4c 45 | 20 2a 66 70 3b 0a 20 20 |. FILE| *fp;. |
|00005170| 20 73 74 72 75 63 74 20 | 76 68 6f 73 74 20 2a 76 | struct |vhost *v|
|00005180| 68 6f 73 74 73 3b 0a 0a | 20 20 20 73 3d 6c 69 73 |hosts;..| s=lis|
|00005190| 74 5f 70 74 72 2d 3e 66 | 64 3b 0a 20 20 20 69 66 |t_ptr->f|d;. if|
|000051a0| 20 28 21 73 74 72 6e 63 | 61 73 65 63 6d 70 28 70 | (!strnc|asecmp(p|
|000051b0| 61 72 67 76 5b 30 5d 2c | 22 71 75 69 74 22 2c 34 |argv[0],|"quit",4|
|000051c0| 29 29 20 7b 0a 20 20 20 | 20 20 20 70 75 74 6c 6f |)) {. | putlo|
|000051d0| 67 28 22 25 73 20 3a 20 | 44 69 73 63 6f 6e 6e 65 |g("%s : |Disconne|
|000051e0| 63 74 69 6e 67 22 2c 6c | 69 73 74 5f 70 74 72 2d |cting",l|ist_ptr-|
|000051f0| 3e 66 72 6f 6d 69 70 29 | 3b 0a 20 20 20 20 20 20 |>fromip)|;. |
|00005200| 63 6c 6f 73 65 28 73 29 | 3b 0a 20 20 20 20 20 20 |close(s)|;. |
|00005210| 64 65 6c 75 63 6f 6e 28 | 26 68 65 61 64 75 63 6f |delucon(|&headuco|
|00005220| 6e 2c 73 29 3b 0a 20 20 | 20 20 20 20 72 65 74 75 |n,s);. | retu|
|00005230| 72 6e 20 31 30 30 3b 0a | 20 20 20 7d 20 65 6c 73 |rn 100;.| } els|
|00005240| 65 20 69 66 20 28 21 73 | 74 72 6e 63 61 73 65 63 |e if (!s|trncasec|
|00005250| 6d 70 28 70 61 72 67 76 | 5b 30 5d 2c 22 6e 69 63 |mp(pargv|[0],"nic|
|00005260| 6b 22 2c 34 29 29 20 7b | 0a 20 20 20 20 20 20 69 |k",4)) {|. i|
|00005270| 66 20 28 70 61 72 67 63 | 3c 32 29 20 72 65 74 75 |f (pargc|<2) retu|
|00005280| 72 6e 20 30 3b 0a 20 20 | 20 20 20 20 73 74 72 6e |rn 0;. | strn|
|00005290| 63 70 79 28 6c 69 73 74 | 5f 70 74 72 2d 3e 6e 69 |cpy(list|_ptr->ni|
|000052a0| 63 6b 2c 70 61 72 67 76 | 5b 31 5d 2c 73 69 7a 65 |ck,pargv|[1],size|
|000052b0| 6f 66 28 6c 69 73 74 5f | 70 74 72 2d 3e 6e 69 63 |of(list_|ptr->nic|
|000052c0| 6b 29 29 3b 0a 20 20 20 | 20 20 20 70 75 74 6c 6f |k));. | putlo|
|000052d0| 67 28 22 25 73 20 3a 20 | 4e 49 43 4b 20 27 25 73 |g("%s : |NICK '%s|
|000052e0| 27 22 2c 6c 69 73 74 5f | 70 74 72 2d 3e 66 72 6f |'",list_|ptr->fro|
|000052f0| 6d 69 70 2c 6c 69 73 74 | 5f 70 74 72 2d 3e 6e 69 |mip,list|_ptr->ni|
|00005300| 63 6b 29 3b 0a 20 20 20 | 20 20 20 6c 69 73 74 5f |ck);. | list_|
|00005310| 70 74 72 2d 3e 6e 3d 31 | 3b 0a 20 20 20 20 20 20 |ptr->n=1|;. |
|00005320| 69 66 20 28 6c 69 73 74 | 5f 70 74 72 2d 3e 70 3d |if (list|_ptr->p=|
|00005330| 3d 30 29 20 7b 0a 20 20 | 20 20 20 20 20 20 20 6e |=0) {. | n|
|00005340| 70 72 69 6e 74 66 28 73 | 2c 22 3a 69 72 63 2e 69 |printf(s|,":irc.i|
|00005350| 62 6e 63 2e 63 6f 6d 20 | 34 36 34 20 25 73 20 3a |bnc.com |464 %s :|
|00005360| 50 61 73 73 77 6f 72 64 | 20 69 6e 63 6f 72 72 65 |Password| incorre|
|00005370| 63 74 5c 6e 22 2c 6c 69 | 73 74 5f 70 74 72 2d 3e |ct\n",li|st_ptr->|
|00005380| 6e 69 63 6b 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |nick);. | |
|00005390| 70 75 74 6c 6f 67 28 22 | 25 73 20 3a 20 44 69 73 |putlog("|%s : Dis|
|000053a0| 63 6f 6e 6e 65 63 74 69 | 6e 67 20 28 70 61 73 73 |connecti|ng (pass|
|000053b0| 20 66 61 69 6c 75 72 65 | 29 22 2c 6c 69 73 74 5f | failure|)",list_|
|000053c0| 70 74 72 2d 3e 66 72 6f | 6d 69 70 29 3b 0a 20 20 |ptr->fro|mip);. |
|000053d0| 20 20 20 20 20 20 20 63 | 6c 6f 73 65 28 73 29 3b | c|lose(s);|
|000053e0| 0a 20 20 20 20 20 20 20 | 20 20 64 65 6c 75 63 6f |. | deluco|
|000053f0| 6e 28 26 68 65 61 64 75 | 63 6f 6e 2c 73 29 3b 0a |n(&headu|con,s);.|
|00005400| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|00005410| 31 30 30 3b 0a 20 20 20 | 20 20 20 7d 0a 20 20 20 |100;. | }. |
|00005420| 7d 20 65 6c 73 65 20 69 | 66 20 28 21 73 74 72 6e |} else i|f (!strn|
|00005430| 63 61 73 65 63 6d 70 28 | 70 61 72 67 76 5b 30 5d |casecmp(|pargv[0]|
|00005440| 2c 22 70 61 73 73 22 2c | 34 29 29 20 7b 0a 20 20 |,"pass",|4)) {. |
|00005450| 20 20 20 20 69 66 20 28 | 70 61 72 67 63 3c 32 29 | if (|pargc<2)|
|00005460| 20 72 65 74 75 72 6e 20 | 30 3b 0a 20 20 20 20 20 | return |0;. |
|00005470| 20 69 66 20 28 21 73 74 | 72 6e 63 6d 70 28 70 61 | if (!st|rncmp(pa|
|00005480| 72 67 76 5b 31 5d 2c 63 | 6f 6e 66 2d 3e 70 61 73 |rgv[1],c|onf->pas|
|00005490| 73 2c 73 74 72 6c 65 6e | 28 63 6f 6e 66 2d 3e 70 |s,strlen|(conf->p|
|000054a0| 61 73 73 29 29 29 20 6c | 69 73 74 5f 70 74 72 2d |ass))) l|ist_ptr-|
|000054b0| 3e 70 3d 31 3b 0a 20 20 | 20 20 20 20 70 75 74 6c |>p=1;. | putl|
|000054c0| 6f 67 28 22 25 73 20 3a | 20 50 41 53 53 20 73 75 |og("%s :| PASS su|
|000054d0| 63 63 65 73 73 66 75 6c | 22 2c 6c 69 73 74 5f 70 |ccessful|",list_p|
|000054e0| 74 72 2d 3e 66 72 6f 6d | 69 70 29 3b 0a 20 20 20 |tr->from|ip);. |
|000054f0| 7d 20 65 6c 73 65 20 69 | 66 20 28 21 73 74 72 6e |} else i|f (!strn|
|00005500| 63 61 73 65 63 6d 70 28 | 70 61 72 67 76 5b 30 5d |casecmp(|pargv[0]|
|00005510| 2c 22 75 73 65 72 22 2c | 34 29 29 20 7b 0a 20 20 |,"user",|4)) {. |
|00005520| 20 20 20 20 70 75 74 6c | 6f 67 28 22 25 73 20 3a | putl|og("%s :|
|00005530| 20 55 53 45 52 20 25 75 | 22 2c 6c 69 73 74 5f 70 | USER %u|",list_p|
|00005540| 74 72 2d 3e 66 72 6f 6d | 69 70 2c 70 61 72 67 63 |tr->from|ip,pargc|
|00005550| 29 3b 0a 20 20 20 20 20 | 20 69 66 20 28 70 61 72 |);. | if (par|
|00005560| 67 63 3c 35 29 20 72 65 | 74 75 72 6e 20 30 3b 0a |gc<5) re|turn 0;.|
|00005570| 20 20 20 20 20 20 73 74 | 72 6e 63 70 79 28 6c 69 | st|rncpy(li|
|00005580| 73 74 5f 70 74 72 2d 3e | 75 73 65 72 2c 70 61 72 |st_ptr->|user,par|
|00005590| 67 76 5b 31 5d 2c 73 69 | 7a 65 6f 66 28 6c 69 73 |gv[1],si|zeof(lis|
|000055a0| 74 5f 70 74 72 2d 3e 75 | 73 65 72 29 29 3b 0a 20 |t_ptr->u|ser));. |
|000055b0| 20 20 20 20 20 66 6f 72 | 28 66 3d 30 3b 66 3c 28 | for|(f=0;f<(|
|000055c0| 70 61 72 67 63 2d 32 29 | 3b 66 2b 2b 29 20 7b 0a |pargc-2)|;f++) {.|
|000055d0| 20 20 20 20 20 20 20 20 | 20 73 74 72 6e 63 61 74 | | strncat|
|000055e0| 28 6c 69 73 74 5f 70 74 | 72 2d 3e 75 73 65 72 2c |(list_pt|r->user,|
|000055f0| 22 20 22 2c 73 69 7a 65 | 6f 66 28 6c 69 73 74 5f |" ",size|of(list_|
|00005600| 70 74 72 2d 3e 75 73 65 | 72 29 29 3b 0a 20 20 20 |ptr->use|r));. |
|00005610| 20 20 20 20 20 20 73 74 | 72 6e 63 61 74 28 6c 69 | st|rncat(li|
|00005620| 73 74 5f 70 74 72 2d 3e | 75 73 65 72 2c 70 61 72 |st_ptr->|user,par|
|00005630| 67 76 5b 32 2b 66 5d 2c | 73 69 7a 65 6f 66 28 6c |gv[2+f],|sizeof(l|
|00005640| 69 73 74 5f 70 74 72 2d | 3e 75 73 65 72 29 29 3b |ist_ptr-|>user));|
|00005650| 0a 20 20 20 20 20 20 7d | 0a 20 20 20 20 20 20 70 |. }|. p|
|00005660| 75 74 6c 6f 67 28 22 25 | 73 20 3a 20 55 53 45 52 |utlog("%|s : USER|
|00005670| 20 27 25 73 27 22 2c 6c | 69 73 74 5f 70 74 72 2d | '%s'",l|ist_ptr-|
|00005680| 3e 66 72 6f 6d 69 70 2c | 6c 69 73 74 5f 70 74 72 |>fromip,|list_ptr|
|00005690| 2d 3e 75 73 65 72 29 3b | 0a 20 20 20 20 20 20 6c |->user);|. l|
|000056a0| 69 73 74 5f 70 74 72 2d | 3e 75 3d 31 3b 0a 20 20 |ist_ptr-|>u=1;. |
|000056b0| 20 7d 20 65 6c 73 65 20 | 69 66 20 28 21 73 74 72 | } else |if (!str|
|000056c0| 6e 63 61 73 65 63 6d 70 | 28 70 61 72 67 76 5b 30 |ncasecmp|(pargv[0|
|000056d0| 5d 2c 22 69 64 65 6e 74 | 22 2c 35 29 29 20 7b 0a |],"ident|",5)) {.|
|000056e0| 20 20 20 20 20 20 69 66 | 20 28 6c 69 73 74 5f 70 | if| (list_p|
|000056f0| 74 72 2d 3e 62 3d 3d 30 | 29 20 72 65 74 75 72 6e |tr->b==0|) return|
|00005700| 20 30 3b 0a 20 20 20 20 | 20 20 69 66 20 28 70 61 | 0;. | if (pa|
|00005710| 72 67 63 3c 32 29 20 72 | 65 74 75 72 6e 20 30 3b |rgc<2) r|eturn 0;|
|00005720| 0a 20 20 20 20 20 20 73 | 74 72 6e 63 70 79 28 6c |. s|trncpy(l|
|00005730| 69 73 74 5f 70 74 72 2d | 3e 69 64 65 6e 74 2c 70 |ist_ptr-|>ident,p|
|00005740| 61 72 67 76 5b 31 5d 2c | 73 69 7a 65 6f 66 28 6c |argv[1],|sizeof(l|
|00005750| 69 73 74 5f 70 74 72 2d | 3e 69 64 65 6e 74 29 29 |ist_ptr-|>ident))|
|00005760| 3b 0a 20 20 20 20 20 20 | 66 70 3d 66 6f 70 65 6e |;. |fp=fopen|
|00005770| 28 63 6f 6e 66 2d 3e 68 | 6f 6d 65 64 69 72 2c 22 |(conf->h|omedir,"|
|00005780| 77 22 29 3b 0a 20 20 20 | 20 20 20 69 66 20 28 66 |w");. | if (f|
|00005790| 70 21 3d 4e 55 4c 4c 29 | 20 7b 0a 20 20 20 20 20 |p!=NULL)| {. |
|000057a0| 20 20 20 20 66 70 72 69 | 6e 74 66 28 66 70 2c 22 | fpri|ntf(fp,"|
|000057b0| 25 73 5c 6e 22 2c 6c 69 | 73 74 5f 70 74 72 2d 3e |%s\n",li|st_ptr->|
|000057c0| 69 64 65 6e 74 29 3b 0a | 20 20 20 20 20 20 20 20 |ident);.| |
|000057d0| 20 66 63 6c 6f 73 65 28 | 66 70 29 3b 0a 20 20 20 | fclose(|fp);. |
|000057e0| 20 20 20 20 20 20 6e 70 | 72 69 6e 74 66 28 73 2c | np|rintf(s,|
|000057f0| 22 4e 4f 54 49 43 45 20 | 41 55 54 48 20 3a 2a 2a |"NOTICE |AUTH :**|
|00005800| 2a 20 59 6f 75 72 20 69 | 64 65 6e 74 20 69 73 20 |* Your i|dent is |
|00005810| 6e 6f 77 20 5c 30 30 32 | 25 73 5c 30 30 32 5c 6e |now \002|%s\002\n|
|00005820| 22 2c 6c 69 73 74 5f 70 | 74 72 2d 3e 69 64 65 6e |",list_p|tr->iden|
|00005830| 74 29 3b 0a 20 20 20 20 | 20 20 20 20 20 70 75 74 |t);. | put|
|00005840| 6c 6f 67 28 22 25 73 20 | 3a 20 49 44 45 4e 54 20 |log("%s |: IDENT |
|00005850| 27 25 73 27 22 2c 6c 69 | 73 74 5f 70 74 72 2d 3e |'%s'",li|st_ptr->|
|00005860| 66 72 6f 6d 69 70 2c 6c | 69 73 74 5f 70 74 72 2d |fromip,l|ist_ptr-|
|00005870| 3e 69 64 65 6e 74 29 3b | 0a 20 20 20 20 20 20 7d |>ident);|. }|
|00005880| 20 65 6c 73 65 20 6e 70 | 72 69 6e 74 66 28 73 2c | else np|rintf(s,|
|00005890| 22 4e 4f 54 49 43 45 20 | 41 55 54 48 20 3a 2a 2a |"NOTICE |AUTH :**|
|000058a0| 2a 20 5c 30 30 32 45 72 | 72 6f 72 20 73 65 74 74 |* \002Er|ror sett|
|000058b0| 69 6e 67 20 69 64 65 6e | 74 21 5c 30 30 32 5c 6e |ing iden|t!\002\n|
|000058c0| 22 29 3b 0a 20 20 20 7d | 20 65 6c 73 65 20 69 66 |");. }| else if|
|000058d0| 20 28 21 73 74 72 6e 63 | 61 73 65 63 6d 70 28 70 | (!strnc|asecmp(p|
|000058e0| 61 72 67 76 5b 30 5d 2c | 22 6f 70 65 72 22 2c 34 |argv[0],|"oper",4|
|000058f0| 29 29 20 7b 0a 20 20 20 | 20 20 20 69 66 20 28 6c |)) {. | if (l|
|00005900| 69 73 74 5f 70 74 72 2d | 3e 62 3d 3d 30 29 20 72 |ist_ptr-|>b==0) r|
|00005910| 65 74 75 72 6e 20 30 3b | 0a 20 20 20 20 20 20 69 |eturn 0;|. i|
|00005920| 66 20 28 70 61 72 67 63 | 3c 32 29 20 72 65 74 75 |f (pargc|<2) retu|
|00005930| 72 6e 20 30 3b 0a 20 20 | 20 20 20 20 69 66 20 28 |rn 0;. | if (|
|00005940| 21 28 2a 63 6f 6e 66 2d | 3e 6f 70 65 72 29 29 20 |!(*conf-|>oper)) |
|00005950| 72 65 74 75 72 6e 20 30 | 3b 0a 20 20 20 20 20 20 |return 0|;. |
|00005960| 69 66 20 28 70 61 72 67 | 63 3d 3d 32 29 20 74 6d |if (parg|c==2) tm|
|00005970| 70 3d 70 61 72 67 76 5b | 31 5d 3b 0a 20 20 20 20 |p=pargv[|1];. |
|00005980| 20 20 65 6c 73 65 20 74 | 6d 70 3d 70 61 72 67 76 | else t|mp=pargv|
|00005990| 5b 32 5d 3b 0a 20 20 20 | 20 20 20 69 66 20 28 21 |[2];. | if (!|
|000059a0| 73 74 72 6e 63 6d 70 28 | 74 6d 70 2c 63 6f 6e 66 |strncmp(|tmp,conf|
|000059b0| 2d 3e 6f 70 65 72 2c 32 | 35 36 29 29 20 7b 0a 20 |->oper,2|56)) {. |
|000059c0| 20 20 20 20 20 20 20 20 | 6c 69 73 74 5f 70 74 72 | |list_ptr|
|000059d0| 2d 3e 73 3d 31 3b 0a 20 | 20 20 20 20 20 20 20 20 |->s=1;. | |
|000059e0| 6e 70 72 69 6e 74 66 28 | 73 2c 22 3a 69 72 63 2e |nprintf(|s,":irc.|
|000059f0| 69 62 6e 63 2e 63 6f 6d | 20 33 38 31 20 25 73 20 |ibnc.com| 381 %s |
|00005a00| 3a 59 6f 75 20 61 72 65 | 20 6e 6f 77 20 61 6e 20 |:You are| now an |
|00005a10| 69 42 4e 43 20 6f 70 65 | 72 61 74 6f 72 5c 6e 22 |iBNC ope|rator\n"|
|00005a20| 2c 6c 69 73 74 5f 70 74 | 72 2d 3e 6e 69 63 6b 29 |,list_pt|r->nick)|
|00005a30| 3b 0a 20 20 20 20 20 20 | 20 20 20 70 75 74 6c 6f |;. | putlo|
|00005a40| 67 28 22 25 73 20 3a 20 | 53 75 63 63 65 73 73 66 |g("%s : |Successf|
|00005a50| 75 6c 20 4f 50 45 52 22 | 2c 6c 69 73 74 5f 70 74 |ul OPER"|,list_pt|
|00005a60| 72 2d 3e 66 72 6f 6d 69 | 70 29 3b 0a 20 20 20 20 |r->fromi|p);. |
|00005a70| 20 20 7d 20 65 6c 73 65 | 20 7b 0a 20 20 20 20 20 | } else| {. |
|00005a80| 20 20 20 20 70 75 74 6c | 6f 67 28 22 25 73 20 3a | putl|og("%s :|
|00005a90| 20 46 61 69 6c 65 64 20 | 4f 50 45 52 22 2c 6c 69 | Failed |OPER",li|
|00005aa0| 73 74 5f 70 74 72 2d 3e | 66 72 6f 6d 69 70 29 3b |st_ptr->|fromip);|
|00005ab0| 0a 20 20 20 20 20 20 20 | 20 20 6e 70 72 69 6e 74 |. | nprint|
|00005ac0| 66 28 73 2c 22 3a 69 72 | 63 2e 69 62 6e 63 2e 63 |f(s,":ir|c.ibnc.c|
|00005ad0| 6f 6d 20 34 36 34 20 25 | 73 20 3a 50 61 73 73 77 |om 464 %|s :Passw|
|00005ae0| 6f 72 64 20 69 6e 63 6f | 72 72 65 63 74 5c 6e 22 |ord inco|rrect\n"|
|00005af0| 2c 6c 69 73 74 5f 70 74 | 72 2d 3e 6e 69 63 6b 29 |,list_pt|r->nick)|
|00005b00| 3b 0a 20 20 20 20 20 20 | 7d 0a 20 20 20 7d 20 65 |;. |}. } e|
|00005b10| 6c 73 65 20 69 66 20 28 | 21 73 74 72 6e 63 61 73 |lse if (|!strncas|
|00005b20| 65 63 6d 70 28 70 61 72 | 67 76 5b 30 5d 2c 22 76 |ecmp(par|gv[0],"v|
|00005b30| 69 70 22 2c 33 29 29 20 | 7b 0a 20 20 20 20 20 20 |ip",3)) |{. |
|00005b40| 69 66 20 28 6c 69 73 74 | 5f 70 74 72 2d 3e 62 3d |if (list|_ptr->b=|
|00005b50| 3d 30 29 20 72 65 74 75 | 72 6e 20 30 3b 0a 20 20 |=0) retu|rn 0;. |
|00005b60| 20 20 20 20 69 66 20 28 | 70 61 72 67 63 3e 31 29 | if (|pargc>1)|
|00005b70| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 68 65 3d 67 | {. | he=g|
|00005b80| 65 74 68 6f 73 74 62 79 | 6e 61 6d 65 28 70 61 72 |ethostby|name(par|
|00005b90| 67 76 5b 31 5d 29 3b 0a | 20 20 20 20 20 20 20 20 |gv[1]);.| |
|00005ba0| 20 69 66 20 28 68 65 29 | 20 7b 0a 20 20 20 20 20 | if (he)| {. |
|00005bb0| 20 20 20 20 20 20 20 6d | 65 6d 63 70 79 28 26 61 | m|emcpy(&a|
|00005bc0| 64 64 72 2e 73 5f 61 64 | 64 72 2c 68 65 2d 3e 68 |ddr.s_ad|dr,he->h|
|00005bd0| 5f 61 64 64 72 2c 73 69 | 7a 65 6f 66 28 61 64 64 |_addr,si|zeof(add|
|00005be0| 72 2e 73 5f 61 64 64 72 | 29 29 3b 0a 20 20 20 20 |r.s_addr|));. |
|00005bf0| 20 20 20 20 20 20 20 20 | 6e 70 72 69 6e 74 66 28 | |nprintf(|
|00005c00| 73 2c 22 4e 4f 54 49 43 | 45 20 41 55 54 48 20 3a |s,"NOTIC|E AUTH :|
|00005c10| 2a 2a 2a 20 59 6f 75 72 | 20 76 68 6f 73 74 20 69 |*** Your| vhost i|
|00005c20| 73 20 6e 6f 77 20 5c 30 | 30 32 25 73 5c 30 30 32 |s now \0|02%s\002|
|00005c30| 20 28 5c 30 30 32 25 73 | 5c 30 30 32 29 5c 6e 22 | (\002%s|\002)\n"|
|00005c40| 2c 70 61 72 67 76 5b 31 | 5d 2c 69 6e 65 74 5f 6e |,pargv[1|],inet_n|
|00005c50| 74 6f 61 28 61 64 64 72 | 29 29 3b 0a 20 20 20 20 |toa(addr|));. |
|00005c60| 20 20 20 20 20 20 20 20 | 73 74 72 6e 63 70 79 28 | |strncpy(|
|00005c70| 6c 69 73 74 5f 70 74 72 | 2d 3e 76 68 6f 73 74 2c |list_ptr|->vhost,|
|00005c80| 70 61 72 67 76 5b 31 5d | 2c 48 4f 53 54 4c 45 4e |pargv[1]|,HOSTLEN|
|00005c90| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 70 |);. | p|
|00005ca0| 75 74 6c 6f 67 28 22 25 | 73 20 3a 20 56 49 50 20 |utlog("%|s : VIP |
|00005cb0| 27 25 73 27 22 2c 6c 69 | 73 74 5f 70 74 72 2d 3e |'%s'",li|st_ptr->|
|00005cc0| 66 72 6f 6d 69 70 2c 6c | 69 73 74 5f 70 74 72 2d |fromip,l|ist_ptr-|
|00005cd0| 3e 76 68 6f 73 74 29 3b | 0a 20 20 20 20 20 20 20 |>vhost);|. |
|00005ce0| 20 20 7d 20 65 6c 73 65 | 20 7b 0a 20 20 20 20 20 | } else| {. |
|00005cf0| 20 20 20 20 20 20 20 6e | 70 72 69 6e 74 66 28 73 | n|printf(s|
|00005d00| 2c 22 4e 4f 54 49 43 45 | 20 41 55 54 48 20 3a 2a |,"NOTICE| AUTH :*|
|00005d10| 2a 2a 20 56 68 6f 73 74 | 20 5c 30 30 32 25 73 5c |** Vhost| \002%s\|
|00005d20| 30 30 32 20 69 73 20 69 | 6e 76 61 6c 69 64 5c 6e |002 is i|nvalid\n|
|00005d30| 22 2c 70 61 72 67 76 5b | 31 5d 29 3b 0a 20 20 20 |",pargv[|1]);. |
|00005d40| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 7d 20 | }.| } |
|00005d50| 65 6c 73 65 20 7b 0a 20 | 20 20 20 20 20 20 20 20 |else {. | |
|00005d60| 66 3d 31 3b 0a 20 20 20 | 20 20 20 20 20 20 76 68 |f=1;. | vh|
|00005d70| 6f 73 74 73 3d 26 63 6f | 6e 66 2d 3e 76 68 6f 73 |osts=&co|nf->vhos|
|00005d80| 74 73 3b 0a 20 20 20 20 | 20 20 20 20 20 69 66 20 |ts;. | if |
|00005d90| 28 76 68 6f 73 74 73 3d | 3d 4e 55 4c 4c 20 7c 7c |(vhosts=|=NULL |||
|00005da0| 20 21 28 2a 76 68 6f 73 | 74 73 2d 3e 68 6f 73 74 | !(*vhos|ts->host|
|00005db0| 29 29 20 6e 70 72 69 6e | 74 66 28 73 2c 22 4e 4f |)) nprin|tf(s,"NO|
|00005dc0| 54 49 43 45 20 41 55 54 | 48 20 3a 4e 6f 20 56 68 |TICE AUT|H :No Vh|
|00005dd0| 6f 73 74 73 20 44 65 66 | 69 6e 65 64 5c 6e 22 29 |osts Def|ined\n")|
|00005de0| 3b 0a 20 20 20 20 20 20 | 20 20 20 65 6c 73 65 20 |;. | else |
|00005df0| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 6e 70 |{. | np|
|00005e00| 72 69 6e 74 66 28 73 2c | 22 4e 4f 54 49 43 45 20 |rintf(s,|"NOTICE |
|00005e10| 41 55 54 48 20 3a 4c 69 | 73 74 20 6f 66 20 56 68 |AUTH :Li|st of Vh|
|00005e20| 6f 73 74 27 73 3a 5c 6e | 22 29 3b 0a 20 20 20 20 |ost's:\n|");. |
|00005e30| 20 20 20 20 20 20 20 20 | 77 68 69 6c 65 20 28 76 | |while (v|
|00005e40| 68 6f 73 74 73 21 3d 4e | 55 4c 4c 29 20 7b 0a 20 |hosts!=N|ULL) {. |
|00005e50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6e 70 | | np|
|00005e60| 72 69 6e 74 66 28 73 2c | 22 4e 4f 54 49 43 45 20 |rintf(s,|"NOTICE |
|00005e70| 41 55 54 48 20 3a 25 33 | 69 3a 20 25 73 5c 6e 22 |AUTH :%3|i: %s\n"|
|00005e80| 2c 66 2c 76 68 6f 73 74 | 73 2d 3e 68 6f 73 74 29 |,f,vhost|s->host)|
|00005e90| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00005ea0| 20 66 2b 2b 3b 0a 20 20 | 20 20 20 20 20 20 20 20 | f++;. | |
|00005eb0| 20 20 20 20 20 76 68 6f | 73 74 73 3d 76 68 6f 73 | vho|sts=vhos|
|00005ec0| 74 73 2d 3e 6e 65 78 74 | 3b 0a 20 20 20 20 20 20 |ts->next|;. |
|00005ed0| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00005ee0| 20 7d 0a 20 20 20 20 20 | 20 7d 0a 20 20 20 7d 20 | }. | }. } |
|00005ef0| 65 6c 73 65 20 69 66 20 | 28 21 73 74 72 6e 63 61 |else if |(!strnca|
|00005f00| 73 65 63 6d 70 28 70 61 | 72 67 76 5b 30 5d 2c 22 |secmp(pa|rgv[0],"|
|00005f10| 63 6f 6e 6e 22 2c 34 29 | 29 20 7b 0a 20 20 20 20 |conn",4)|) {. |
|00005f20| 20 20 69 66 20 28 6c 69 | 73 74 5f 70 74 72 2d 3e | if (li|st_ptr->|
|00005f30| 62 20 3d 3d 20 30 29 20 | 72 65 74 75 72 6e 20 30 |b == 0) |return 0|
|00005f40| 3b 0a 20 20 20 20 20 20 | 69 66 20 28 21 70 61 72 |;. |if (!par|
|00005f50| 67 63 3c 32 29 20 7b 0a | 20 20 20 20 20 20 20 20 |gc<2) {.| |
|00005f60| 20 69 66 20 28 70 61 72 | 67 63 3e 32 29 20 64 70 | if (par|gc>2) dp|
|00005f70| 6f 72 74 3d 61 74 6f 69 | 28 70 61 72 67 76 5b 32 |ort=atoi|(pargv[2|
|00005f80| 5d 29 3b 0a 20 20 20 20 | 20 20 20 20 20 65 6c 73 |]);. | els|
|00005f90| 65 20 64 70 6f 72 74 3d | 63 6f 6e 66 2d 3e 64 70 |e dport=|conf->dp|
|00005fa0| 6f 72 74 3b 0a 20 20 20 | 20 20 20 20 20 20 6e 70 |ort;. | np|
|00005fb0| 72 69 6e 74 66 28 73 2c | 22 4e 4f 54 49 43 45 20 |rintf(s,|"NOTICE |
|00005fc0| 41 55 54 48 20 3a 43 6f | 6e 6e 65 63 74 69 6e 67 |AUTH :Co|nnecting|
|00005fd0| 20 74 6f 20 5c 30 30 32 | 25 73 5c 30 30 32 20 28 | to \002|%s\002 (|
|00005fe0| 5c 30 30 32 25 69 5c 30 | 30 32 29 5c 6e 22 2c 70 |\002%i\0|02)\n",p|
|00005ff0| 61 72 67 76 5b 31 5d 2c | 64 70 6f 72 74 29 3b 0a |argv[1],|dport);.|
|00006000| 20 20 20 20 20 20 20 20 | 20 63 73 3d 64 6f 5f 63 | | cs=do_c|
|00006010| 6f 6e 6e 65 63 74 28 6c | 69 73 74 5f 70 74 72 2d |onnect(l|ist_ptr-|
|00006020| 3e 76 68 6f 73 74 2c 70 | 61 72 67 76 5b 31 5d 2c |>vhost,p|argv[1],|
|00006030| 64 70 6f 72 74 29 3b 0a | 20 20 20 20 20 20 20 20 |dport);.| |
|00006040| 20 69 66 20 28 63 73 3e | 30 29 20 7b 0a 20 20 20 | if (cs>|0) {. |
|00006050| 20 20 20 20 20 20 20 20 | 20 6e 70 72 69 6e 74 66 | | nprintf|
|00006060| 28 73 2c 22 4e 4f 54 49 | 43 45 20 41 55 54 48 20 |(s,"NOTI|CE AUTH |
|00006070| 3a 53 75 63 63 65 73 73 | 66 75 6c 6c 79 20 63 6f |:Success|fully co|
|00006080| 6e 6e 65 63 74 65 64 20 | 74 6f 20 5c 30 30 32 25 |nnected |to \002%|
|00006090| 73 5c 30 30 32 5c 6e 22 | 2c 70 61 72 67 76 5b 31 |s\002\n"|,pargv[1|
|000060a0| 5d 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |]);. | |
|000060b0| 70 75 74 6c 6f 67 28 22 | 25 73 20 3a 20 43 4f 4e |putlog("|%s : CON|
|000060c0| 4e 20 27 25 73 3a 25 75 | 27 22 2c 6c 69 73 74 5f |N '%s:%u|'",list_|
|000060d0| 70 74 72 2d 3e 66 72 6f | 6d 69 70 2c 70 61 72 67 |ptr->fro|mip,parg|
|000060e0| 76 5b 31 5d 2c 64 70 6f | 72 74 29 3b 0a 20 20 20 |v[1],dpo|rt);. |
|000060f0| 20 20 20 20 20 20 20 20 | 20 69 66 20 28 70 61 72 | | if (par|
|00006100| 67 63 3e 33 29 20 6e 70 | 72 69 6e 74 66 28 63 73 |gc>3) np|rintf(cs|
|00006110| 2c 22 50 41 53 53 20 3a | 25 73 5c 6e 22 2c 70 61 |,"PASS :|%s\n",pa|
|00006120| 72 67 76 5b 33 5d 29 3b | 0a 20 20 20 20 20 20 20 |rgv[3]);|. |
|00006130| 20 20 20 20 20 6e 70 72 | 69 6e 74 66 28 63 73 2c | npr|intf(cs,|
|00006140| 22 55 53 45 52 20 25 73 | 5c 6e 22 2c 6c 69 73 74 |"USER %s|\n",list|
|00006150| 5f 70 74 72 2d 3e 75 73 | 65 72 29 3b 0a 20 20 20 |_ptr->us|er);. |
|00006160| 20 20 20 20 20 20 20 20 | 20 6e 70 72 69 6e 74 66 | | nprintf|
|00006170| 28 63 73 2c 22 4e 49 43 | 4b 20 25 73 5c 6e 22 2c |(cs,"NIC|K %s\n",|
|00006180| 6c 69 73 74 5f 70 74 72 | 2d 3e 6e 69 63 6b 29 3b |list_ptr|->nick);|
|00006190| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 |. | if |
|000061a0| 28 28 62 6f 62 3d 61 64 | 64 63 6f 6e 28 26 68 65 |((bob=ad|dcon(&he|
|000061b0| 61 64 63 6f 6e 29 29 3d | 3d 4e 55 4c 4c 29 20 7b |adcon))=|=NULL) {|
|000061c0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000061d0| 63 6c 6f 73 65 28 63 73 | 29 3b 0a 20 20 20 20 20 |close(cs|);. |
|000061e0| 20 20 20 20 20 20 20 20 | 20 20 63 6c 6f 73 65 28 | | close(|
|000061f0| 73 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |s);. | |
|00006200| 7d 20 65 6c 73 65 20 7b | 0a 20 20 20 20 20 20 20 |} else {|. |
|00006210| 20 20 20 20 20 20 20 20 | 62 6f 62 2d 3e 69 66 64 | |bob->ifd|
|00006220| 3d 73 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |=s;. | |
|00006230| 20 20 20 62 6f 62 2d 3e | 6f 66 64 3d 63 73 3b 0a | bob->|ofd=cs;.|
|00006240| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 73 | | s|
|00006250| 74 72 6e 63 70 79 28 62 | 6f 62 2d 3e 6e 69 63 6b |trncpy(b|ob->nick|
|00006260| 2c 6c 69 73 74 5f 70 74 | 72 2d 3e 6e 69 63 6b 2c |,list_pt|r->nick,|
|00006270| 73 69 7a 65 6f 66 28 62 | 6f 62 2d 3e 6e 69 63 6b |sizeof(b|ob->nick|
|00006280| 29 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |));. | |
|00006290| 20 20 20 73 74 72 6e 63 | 70 79 28 62 6f 62 2d 3e | strnc|py(bob->|
|000062a0| 66 72 6f 6d 69 70 2c 6c | 69 73 74 5f 70 74 72 2d |fromip,l|ist_ptr-|
|000062b0| 3e 66 72 6f 6d 69 70 2c | 48 4f 53 54 4c 45 4e 29 |>fromip,|HOSTLEN)|
|000062c0| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|000062d0| 20 64 65 6c 75 63 6f 6e | 28 26 68 65 61 64 75 63 | delucon|(&headuc|
|000062e0| 6f 6e 2c 73 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |on,s);. | |
|000062f0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 31 30 30 | re|turn 100|
|00006300| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 7d 0a |;. | }.|
|00006310| 20 20 20 20 20 20 20 20 | 20 7d 20 65 6c 73 65 20 | | } else |
|00006320| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 69 66 |{. | if|
|00006330| 20 28 63 73 3d 3d 2d 31 | 29 20 6e 70 72 69 6e 74 | (cs==-1|) nprint|
|00006340| 66 28 73 2c 22 4e 4f 54 | 49 43 45 20 41 55 54 48 |f(s,"NOT|ICE AUTH|
|00006350| 20 3a 46 61 69 6c 65 64 | 20 63 6f 6e 6e 65 63 74 | :Failed| connect|
|00006360| 69 6f 6e 20 74 6f 20 5c | 30 30 32 25 73 5c 30 30 |ion to \|002%s\00|
|00006370| 32 20 28 42 61 64 20 56 | 48 6f 73 74 29 5c 6e 22 |2 (Bad V|Host)\n"|
|00006380| 2c 70 61 72 67 76 5b 31 | 5d 29 3b 0a 20 20 20 20 |,pargv[1|]);. |
|00006390| 20 20 20 20 20 20 20 20 | 65 6c 73 65 20 6e 70 72 | |else npr|
|000063a0| 69 6e 74 66 28 73 2c 22 | 4e 4f 54 49 43 45 20 41 |intf(s,"|NOTICE A|
|000063b0| 55 54 48 20 3a 46 61 69 | 6c 65 64 20 63 6f 6e 6e |UTH :Fai|led conn|
|000063c0| 65 63 74 69 6f 6e 20 74 | 6f 20 5c 30 30 32 25 73 |ection t|o \002%s|
|000063d0| 5c 30 30 32 5c 6e 22 2c | 70 61 72 67 76 5b 31 5d |\002\n",|pargv[1]|
|000063e0| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 7d 0a 20 20 |);. | }. |
|000063f0| 20 20 20 20 7d 0a 20 20 | 20 7d 20 65 6c 73 65 20 | }. | } else |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.